A BILSTM multi-label text classification method based on attention mechanism

By using the BILSTM method based on the attention mechanism in multi-label text classification, combined with the Bert and Word2vec models, the contextual information of text and labels is extracted, which solves the problems of inter-label correlation and text label fusion, and achieves more efficient multi-label Text classification.

CN114398488BActive Publication Date: 2024-08-27UNICOM WOYUEDU TECH CULTURE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210047500.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-17
Publication Date
2024-08-27
Estimated Expiration
2042-01-17

AI Technical Summary

Technical Problem

Existing multi-label text classification methods fail to effectively consider the correlation between labels and the integration of document content and label content, resulting in low classification efficiency and accuracy.

Method used

The BILSTM multi-label text classification method based on the attention mechanism is used, word embedding is performed through the Bert model and the Word2vec model, and the BILSTM module and the attention mechanism module are combined to extract the contextual information of the text and labels, and the self-attention mechanism and label attention are used Mechanism improves relevance and integration effects.

Benefits of technology

It improves the accuracy and classification efficiency of multi-label text classification, enhances the correlation between text and labels, and improves classification accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114398488B
    Figure CN114398488B
Patent Text Reader

Abstract

The invention belongs to the field of natural language processing and multi-label text classification, and particularly relates to a BILSTM multi-label text classification method based on an attention mechanism; the method comprises the following steps: embedding text data and label data through Bert and Word2vec respectively; extracting context information of the text data and label data after word embedding through a BILSTM module respectively, and obtaining text representation and label representation; obtaining label-based text representation through an attention mechanism module; training a multi-label text classification model through a loss function; inputting real-time data into a trained multi-label text classification model, and obtaining label classification prediction results of the real-time data; the invention utilizes Bert for word embedding, utilizes BILSTM for extracting context dependency, and fully utilizes information of text and text, text and label, and label and label, thereby improving the accuracy and normalized discounted cumulative gain of multi-label text classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of natural language processing and multi-label text classification, and in particular relates to a BILSTM multi-label text classification method based on an attention mechanism. Background Art

[0002] Text is one of the important carriers of information. The topics and scales of text information are diverse and vary greatly. How to efficiently process text information is a problem of great research significance, which has promoted the rapid development of automatic text classification technology. Text classification is an important and classic problem in natural language processing (NLP). In traditional text classification problems, each sample has only one category label, and each category label is independent of each other, and the classification granularity is relatively coarse. This is called single-label text classification. With the increasing richness of text information, the classification granularity is getting higher and higher. A sample is related to multiple category labels, and there is a certain dependency between category labels. This is called multi-label text classification.

[0003] Multi-label text classification is an important branch of multi-label classification. Multi-label text classification methods are divided into two categories: traditional machine learning methods and deep learning-based methods. The first traditional machine learning method includes problem conversion methods and algorithm adaptation methods; the second deep learning-based method uses various neural network models to handle multi-label text classification problems. According to the structure of the network, it can be divided into multi-label text classification methods based on convolutional neural network structure, recurrent neural network structure and Transformer structure. There are many studies on multi-label text classification, but there are still several problems:

[0004] 1. Research on the correlation between labels. The labels in the multi-label text classification problem are intrinsically related. Some traditional methods often do not consider the correlation between labels when dealing with multi-label text classification problems, resulting in low efficiency of multi-label text classification.

[0005] 2. Research issues on the correlation between document content and label content. The fusion effect of document content and label content is not good, which affects the classification accuracy. Summary of the invention

[0006] To solve the above problems, the present invention provides a BILSTM multi-label text classification method based on an attention mechanism, constructs a multi-label text classification model, and the multi-label text classification model includes a BERT model, a Word2vec model, a BILSTM module, and an attention mechanism module. The BILSTM multi-label text classification method based on the attention mechanism includes the following steps:

[0007] S1. Embed the text data into words through the bert model, and embed the label data into words through the Word2vec model;

[0008] S2. Use the BILSTM module to extract context information from the text data and label data after word embedding to obtain text representation and label representation;

[0009] S3. Use the attention mechanism module to process the text representation and label representation to obtain the label-based text representation;

[0010] S4. Calculate the loss of the label-based text representation through the loss function until convergence, and obtain a trained multi-label text classification model;

[0011] S5. Input the real-time data into the trained multi-label text classification model to obtain the label classification prediction results of the real-time data.

[0012] Furthermore, step S2 uses the BILSTM module to learn the text data and label data after word embedding to obtain text representation and label representation, which are expressed as:

[0013]

[0014]

[0015]

[0016]

[0017]

[0018]

[0019] Among them, H is the text representation, is the positive text representation, is the reverse text representation, represents the positive text representation at time step p, represents the reverse text representation at time step p, H' is the label representation, is the positive label representation, is the reverse label representation, represents the positive label representation at time step p, represents the reverse label representation at time step p, R represents the dimension range, and H belongs to R 2k×n ,H` belongs to R 2k×l ,in:

[0020]

[0021]

[0022]

[0023]

[0024] in, and All belong to R k , k represents the size of the LSTM hidden layer, V t is the embedding vector of the tth word in the text data, represents the positive text representation at time step p-1, represents the reverse text representation at time step p-1, V t ` is the embedding vector of the tth word in the label data, represents the positive label representation at time step p-1, represents the reverse label representation at time step p-1.

[0025] Furthermore, the process of obtaining the tag-based text representation in step S3 includes:

[0026] S11. Send the text representation to the self-attention mechanism to obtain the label document representation under the self-attention mechanism;

[0027] S12. Send the label data and text representation after word embedding into the label attention mechanism to obtain the document representation with all labels;

[0028] S13. Fuse the labeled document representation obtained in S11 under the self-attention mechanism and the document representation with all labels obtained in S12 to obtain a fused document representation;

[0029] S14. Send the label text to the self-attention mechanism for processing, and fuse the processing result with the fused document representation of S13 to obtain a label-based text representation.

[0030] Furthermore, step S11 uses the label attention score to obtain a linear combination of each label context word in the text data, and obtains the label document representation of the text representation under the self-attention mechanism according to the linear combination of each label context word. The label attention score and the linear combination of each label context word are respectively expressed as:

[0031] A (s) =softmax(W2tanh(W1H));

[0032]

[0033] Among them, A (s)is the label attention score, R represents the dimension range, W1, W2 are self-attention parameters, d a is a hyperparameter, H is the text representation, tanh() is the activation function, represents the contribution of all words to the jth label, is the label document representation under the self-attention mechanism along the jth label, H T is the transposed matrix of the text representation H.

[0034] Furthermore, step S12 obtains the document representation after all tags including:

[0035] Convert the label data after word embedding into a trainable matrix, construct the semantic relationship between the text representation and the trainable matrix by linearly combining the context words of the label, and obtain the document representation of all labels based on the semantic relationship between the text representation and the trainable matrix in:

[0036]

[0037]

[0038]

[0039]

[0040] C represents the trainable matrix of label data after word embedding, R represents the dimension range, C∈R l×k , is the positive text representation, is the reverse text representation, is the positive representation of the context word of the linear combination label, is the reverse representation of the context word of the linear combination label, is the positive representation of the document representation of all labels, is the transposed matrix of the forward text representation, is the reverse representation of the document representation of all labels, Represented as the transposed matrix of the reverse text representation.

[0041] Furthermore, the fusion process of step S13 includes:

[0042]

[0043]

[0044] Among them, M j is the first fused document representation along the jth tag, is the label document representation along the jth label, is the document representation of the jth label, α j is the self-attention weight, L α is the first parameter, L β is the second parameter.

[0045] Furthermore, the process of obtaining a label-based text representation includes:

[0046] S21. The dependency relationship of each label in the label text is captured through the self-attention mechanism to obtain the label word attention score of the label text;

[0047] S22. Obtain a linear combination of each label according to the label word attention score of the label text, and obtain a label representation specific to the label under the self-attention mechanism through the linear combination of each label;

[0048] S23. The tag-specific tag representation under the self-attention mechanism is fused with the fused document representation to obtain a tag-based text representation.

[0049] Furthermore, before the fusion in step S23, the fused document representation is processed through a fully connected layer to obtain a first text, the tag representation is processed through a fully connected layer to obtain a second text, and the first text and the second text are fused to obtain a tag-based text representation, and the processing formula is:

[0050] a=sigmoid(W5M)

[0051] d = sigmoid(W6M` (s) )

[0052] z=BN[a,d]

[0053] Among them, a is the first text, d is the second text, M is the fused document representation, M` (s) is the label representation, BN[·] is batch normalization, z is the label-based text representation, and W5 and W6 are weight values.

[0054] Furthermore, according to the label-based text representation, the predicted probability of classification is calculated by the sigmoid function It is expressed as:

[0055]

[0056] Among them, reshape(·) is the reshape function, b is the bias, W7 is the weight, sigmoid() is the sigmoid function, z T is the transpose of the label-based text representation.

[0057] Furthermore, the loss function is expressed as:

[0058]

[0059] Among them, N is the total number of text data, l is the total number of label data, is the predicted probability, y ij ∈{0,1} represents the classification accuracy of the i-th document along the j-th label.

[0060] Beneficial effects of the present invention:

[0061] The present invention uses the Bert model to embed words into text data, and uses the Word2vec model to embed words into label data, and converts the label data after word embedding into a trainable matrix, so as to solve the relationship between text and label, better improve the classification accuracy, and enhance the sensitivity of labels in text. Compared with text data, label data generally has dozens or more than 100 labels. Using word2vec to process label data reduces complexity and improves processing speed. After word embedding, BILSTM is used to extract context dependency, and a self-attention mechanism is used to process text and label respectively, so as to improve the correlation between text and text, and between label and label. In addition, a label attention mechanism is used to process the text context relationship extracted by BILSTM and the label after word embedding, so as to improve the correlation between text and label, and the text under the self-attention mechanism and the text and label under the label attention mechanism are fused, and the fusion result is fused again with the label under the self-attention mechanism, so as to improve the accuracy of multi-label text classification and the normalized discounted cumulative gain. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is the overall flow chart of the present invention;

[0063] Figure 2 It is a mechanism diagram of LSTM of the present invention;

[0064] Figure 3 It is a bidirectional LSTM model structure diagram of the present invention;

[0065] Figure 4 This is a block diagram of the BILSTM multi-label text classification method based on the attention mechanism of the present invention. DETAILED DESCRIPTION

[0066] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0067] A BILSTM multi-label text classification method based on attention mechanism, such as Figure 1 As shown, the following steps are included:

[0068] S1. Embed the text data into words through the bert model, and embed the label data into words through the Word2vec model;

[0069] S2. Use the BILSTM module to extract context information from the text data and label data after word embedding to obtain text representation and label representation;

[0070] S3. Use the attention mechanism module to process the text representation and label representation to obtain the label-based text representation;

[0071] S4. Calculate the loss of the label-based text representation through the loss function until convergence, and obtain a trained multi-label text classification model;

[0072] S5. Input the real-time data into the trained multi-label text classification model to obtain the label classification prediction results of the real-time data.

[0073] Specifically, the overall block diagram of the BILSTM multi-label text classification method based on the attention mechanism is as follows: Figure 4 As shown in the figure, the multi-label text classification model includes the BERT model, the Word2vec model, the BILSTM module, and the attention mechanism module. The specific implementation process includes:

[0074] S11. Input text data into the bert model for word embedding, and embed the label data into the Word2vec model;

[0075] S12. Use the BILSTM model to extract context information from the text data and label data after word embedding to obtain text representation and label representation;

[0076] S13. Send the text representation to the self-attention mechanism to obtain the label document representation under the self-attention mechanism;

[0077] S14. Send the label data and text representation after word embedding into the label attention mechanism to obtain the document representation with all labels;

[0078] S15. The labeled document representation obtained in S13 under the self-attention mechanism and the document representation with all labels obtained in S14 are fused to obtain the fused document representation, i.e. Figure 4 As shown in A;

[0079] S16. Send the label text to the self-attention mechanism for processing, and fuse the processing result with the fused document representation of S15 to obtain the label-based text representation, that is, Figure 4 As shown in B;

[0080] S17. The label-based text representation is processed through the sigmoid function to obtain the final label classification prediction result.

[0081] In one embodiment, the text data is input into the BERT model, which processes the text data through word embedding, sentence embedding, and position embedding in turn to obtain a text output vector containing words, sentences, and positions, which is represented as {V1, V2, ..., V p ,...,V n}, n represents the maximum embedding word length. In this embodiment, n = 300, and the dimension of the BERT model is set to 768;

[0082] The label data is embedded in words through Word2vec, and the embedding dimension is set to k, using {V′1,V′2,…V′ p ,…,V′ l} represents the label output vector, l represents the number of embedded labels, and in this embodiment, k=300.

[0083] In one embodiment, the BILSTM model is used to learn the text data and label data after word embedding to obtain text representation and label representation, wherein the structure of LSTM is as follows: Figure 2 As shown, the various operations in the LSTM structure are expressed as:

[0084] D f =sigmoid(W f [x i ,s t-1 ]+b f );

[0085] D in =sigmoid(W in [x i ,s t-1 ]+b in );

[0086] C t =tanh(W c [x i ,s t-1 ]+bc );

[0087] C t =D f *C t-1 +D in *C t ;

[0088] D0=sigmoid(W o [x i ,s t-1 ]+b o );

[0089] s t =D0*tanh(C t );

[0090] Among them, x i represents the input vector, W f , W in , W c Respectively represent the weight of the forget gate, the weight of the input gate, and the weight of the input unit at time t. f , b in , b c They represent the forget gate bias, input gate bias, and input unit bias at time t, respectively. t-1 represents the cell state information at time t-1, D f and D in Represent the output of the forget gate and the output of the input gate, respectively, C t represents the unit state input at time t, C t represents the updated cell state information, D0 represents the output gate output, s t represents the hidden layer state at time t.

[0091] Perform BILSTM operations based on LSTM:

[0092] Preferably, the BILSTM model is used to learn the text data and label data after word embedding to obtain the text representation and label representation, which are expressed as:

[0093]

[0094]

[0095]

[0096]

[0097]

[0098]

[0099] Among them, H is the text representation, is the positive text representation, is the reverse text representation, represents the positive text representation at time step p, represents the reverse text representation at time step p, H' is the label representation, is the positive label representation, is the reverse label representation, represents the positive label representation at time step p, represents the reverse label representation at time step p, R represents the dimension range, and H belongs to R 2k×n ,H` belongs to R 2k×l ,in:

[0100]

[0101]

[0102]

[0103]

[0104] in, and All belong to R k , k represents the size of the LSTM hidden layer, V t is the embedding vector of the tth word in the text data, represents the positive text representation at time step p-1, represents the reverse text representation at time step p-1, V t ` is the embedding vector of the tth word in the label data, represents the positive label representation at time step p-1, represents the reverse label representation at time step p-1;

[0105] like Figure 3 As shown, BILSTM is used to learn the text data and label data after word embedding. At the time step p, the hidden state can be updated through the input and (p-1) step output. k represents the size of the LSTM hidden layer, which is set to k=300 in this embodiment.

[0106] Multi-label documents may be marked with multiple labels, and each document should have the most relevant context to its corresponding label. In other words, each document may contain multiple labels, and the words in a document make different contributions to each label.

[0107] In one embodiment, in order to obtain the different contributions of each label, a self-attention mechanism is used, which specifically includes: using the label attention score to obtain a linear combination of each label context word in the text data, and obtaining a label document representation of the text representation under the self-attention mechanism according to the linear combination of each label context word. The label attention score and the linear combination of each label context word are respectively expressed as:

[0108] A (s) =softmax(W2tanh(W1H));

[0109]

[0110] Among them, A (s) Score the label attention, W1 and W2 represent the self-attention parameters to be trained, d a is a hyperparameter. In this embodiment, d a =200, H is the text representation, tanh() is the activation function, Represents the contribution of all words in the text data to the jth label, is the label document representation under the self-attention mechanism along the jth label, H T is the transposed matrix of the text representation; finally, the label document representation M of the text representation under the self-attention mechanism is obtained (s) , M (s) ∈R l×2k .

[0111] In order to utilize the semantic information of the label, the label is preprocessed by Word2vec and represented as a trainable matrix C∈R l×k , that is, the same latent k-dimensional space as words. With the text word embedding after BILSTM and the label embedding at the same time, the semantic relationship between each pair of words and labels can be explicitly determined.

[0112] In one embodiment, the semantic relationship between the text representation and the label data after word embedding is constructed by linearly combining the context words of the labels, and the document representation after all labels is obtained according to the semantic relationship between the text representation and the label data after word embedding. in:

[0113]

[0114]

[0115]

[0116]

[0117] C represents the trainable matrix of label data after word embedding, C∈R l×k , is the positive text representation, is the reverse text representation, is the positive representation of the context word of the linear combination label, is the reverse representation of the context word of the linear combination label, is the positive representation of the document representation of all labels, is the transposed matrix of the forward text representation, is the reverse representation of the document representation of all labels, Represented as the transposed matrix of the reverse text representation.

[0118] M (s) and M (l) are both tag-specific document representations, but they are different. (s) Focuses on document content, while M (l) More inclined to the semantic association between document content and label text, two weight vectors (α, β∈R l ) to determine the importance of the above two parts, which are input into M (s) and M (l) The fully connected layer on top is obtained;

[0119]

[0120] is the label document representation along the jth label, is the document representation of the jth label, α j is the self-attention weight, L α is the first parameter, L β As the second parameter, constraints are added to the two weight parameters, and the first fused document representation along the jth label is obtained according to the fusion weight, that is,

[0121] By introducing the self-attention weight value, according to the above fusion weight method, the first fused document representation M after fusion is obtained, M∈R l×2k .

[0122] In one embodiment, a tag score of each tag is obtained to obtain a tag-specific tag representation based on a self-attention mechanism, and then obtain a tag-based text representation. The specific steps are as follows:

[0123] S21. The dependency relationship of each label in the label text is captured through the self-attention mechanism to obtain the label word attention score of the label text;

[0124] S22. Obtain a linear combination of each label according to the label word attention score of the label text, and obtain a label representation specific to the label under the self-attention mechanism through the linear combination of each label;

[0125] S23. The tag-specific document representation under the self-attention mechanism is fused with the tag document representation under the self-attention mechanism to obtain a tag-based text representation.

[0126] Specifically, the label word attention score of the label text is expressed as:

[0127]

[0128] in, W3 and W4 are self-attention parameters, d a is a hyperparameter, H' is a label representation, and in this embodiment, d is set a =200;

[0129] Specifically, step S22 includes:

[0130]

[0131] represents the contribution of all labels to the jth label, Represents the label representation specific to the jth label under the self-attention mechanism, the matrix M` (s) ∈R l×2k is the label-specific label representation under the self-attention mechanism;

[0132] In this embodiment, the label attention mechanism is that various types of labels in the label data are used in the text information in the text data, which is the association between text and label, so it is called the label attention mechanism; in the present invention, the self-attention mechanism is used twice, the first one is based on the association between text and text, specifically, the association between text content and labels in the text, and the second one is based on the association between labels.

[0133] The fusion method used is that multi-label text classification is a nonlinear problem. Therefore, the first fused document is processed through a fully connected layer to obtain a, and the label representation is also processed through a fully connected layer to obtain d, and then fused by splicing. This makes the document label information more complete and more sensitive to the label. The fused representation is then sent to batch normalization (BN) for processing. The advantage of this is that it can better speed up the training without changing the dimension and reduce the dependency between parameters. The specific formula is as follows:

[0134] a=sigmoid(W5M)

[0135] d = sigmoid(W6M` (s) )

[0136] z=BN[a,d]

[0137] W5∈R 1×l ,W6∈R 1×l ,a∈R 1×2k ,b∈R 1×2k ,z∈R 1×4k , z is the textual representation based on the label.

[0138] Once we have a comprehensive label-specific document representation, we can reshape the matrix through the reshape function to get a vector of l rows and l columns, and then output it through the final sigmoid function. Mathematically, the predicted probability of each label can be calculated as follows:

[0139]

[0140] W7∈R l×4k ;

[0141] Among them, reshape(·) is the reshape function, b is the bias, W7 is the weight, sigmoid() is the sigmoid function, z T The sigmoid function is used to convert the output value into a probability based on the transposition of the label-based text representation. At this time, the cross entropy loss can be used as the loss function:

[0142]

[0143] Where N is the number of training documents, l is the number of labels, is the predicted probability, y ij ∈{0,1} represents the classification accuracy of the i-th document along the j-th label, W5 is the fully connected layer parameter, W7 is the output layer parameter, and sigmoid() is the sigmoid function.

[0144] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A BILSTM multi-label text classification method based on attention mechanism, characterized in that: Construct a multi-label text classification model. The multi-label text classification model includes the Bert model, the Word2vec model, the BILSTM module, and the attention mechanism module. The BILSTM multi-label text classification method based on the attention mechanism includes the following steps: S1. Embed the text data into words through the bert model, and embed the label data into words through the Word2vec model; S2. Use the BILSTM module to extract context information from the text data and label data after word embedding to obtain text representation and label representation; S3. Use the attention mechanism module to process the text representation and label representation to obtain the label-based text representation; The process of obtaining the tag-based text representation in step S3 includes: S11. Send the text representation to the self-attention mechanism to obtain the label document representation under the self-attention mechanism; S12. Send the label data and text representation after word embedding into the label attention mechanism to obtain the document representation with all labels; S13. Fuse the labeled document representation obtained in S11 under the self-attention mechanism and the document representation with all labels obtained in S12 to obtain a fused document representation; S14. Send the label text to the self-attention mechanism for processing, and fuse the processing result with the fused document representation of S13 to obtain a label-based text representation; The fusion process of step S13 includes: Among them, M j is the first fused document representation along the jth tag, is the label document representation along the jth label, is the document representation of the jth label, α j is the self-attention weight, L α is the first parameter, L β is the second parameter; The process of obtaining a label-based text representation includes: S21. The dependency relationship of each label in the label text is captured through the self-attention mechanism to obtain the label word attention score of the label text; S22. Obtain a linear combination of each label according to the label word attention score of the label text, and obtain a label representation specific to the label under the self-attention mechanism through the linear combination of each label; S23. Fusing the tag-specific tag representation under the self-attention mechanism with the fused document representation to obtain a tag-based text representation; Before fusion in step S23, the fused document representation is processed through a fully connected layer to obtain a first text, the tag representation is processed through a fully connected layer to obtain a second text, and the first text and the second text are fused to obtain a tag-based text representation, and the processing formula is: a=sigmoid(W5M) d=sigmoid(W6M` (s) ) z=BN[a,d] Among them, a is the first text, d is the second text, M is the fused document representation, M` (s) is the label representation, BN[·] is batch normalization, z is the label-based text representation, W5 and W6 are weight values; Based on the label-based text representation, the predicted probability of the classification is calculated through the sigmoid function It is expressed as: Among them, reshape(·) is the reshape function, b is the bias, W7 is the weight, sigmoid() is the sigmoid function, z T is the transpose of the label-based text representation; S4. Calculate the loss of the label-based text representation through the loss function until convergence, and obtain a trained multi-label text classification model; The loss function is expressed as: Among them, N is the total number of text data, l is the total number of label data, is the predicted probability, y ij ∈{0,1} represents the classification accuracy of the i-th document along the j-th label; S5. Input the real-time data into the trained multi-label text classification model to obtain the label classification prediction results of the real-time data.

2. The BILSTM multi-label text classification method based on the attention mechanism according to claim 1, characterized in that: Step S2 uses the BILSTM module to learn the text data and label data after word embedding to obtain text representation and label representation, which are expressed as: Among them, H is the text representation, is the positive text representation, is the reverse text representation, represents the positive text representation at time step p, represents the reverse text representation at time step p, H' is the label representation, is the positive label representation, is the reverse label representation, represents the positive label representation at time step p, represents the reverse label representation at time step p, R represents the dimension range, and H belongs to R 2k×n ,H` belongs to R 2k×l ,in: in, and All belong to R k , k represents the size of the LSTM hidden layer, V t is the embedding vector of the tth word in the text data, represents the positive text representation at time step p-1, represents the reverse text representation at time step p-1, V t ` is the embedding vector of the tth word in the label data, represents the positive label representation at time step p-1, represents the reverse label representation at time step p-1.

3. The BILSTM multi-label text classification method based on the attention mechanism according to claim 1, characterized in that: Step S11 uses the label attention score to obtain the linear combination of each label context word in the text data, and obtains the label document representation of the text representation under the self-attention mechanism according to the linear combination of each label context word. The label attention score and the linear combination of each label context word are respectively expressed as: A (s) =softmax(W2tanh(W1H)); Among them, A (s) Score the label attention, W1, W2 are self-attention parameters, d a is a hyperparameter, H is the text representation, tanh() is the activation function, represents the contribution of all words to the jth label, is the label document representation under the self-attention mechanism along the jth label, H T is the transposed matrix of the text representation H.

4. The BILSTM multi-label text classification method based on the attention mechanism according to claim 1, characterized in that: Step S12 obtains the document representation after all tags, including: Convert the label data after word embedding into a trainable matrix, construct the semantic relationship between the text representation and the trainable matrix by linearly combining the context words of the label, and obtain the document representation of all labels based on the semantic relationship between the text representation and the trainable matrix in: C represents the trainable matrix of label data after word embedding, C∈R l×k , is the positive text representation, is the reverse text representation, is the positive representation of the context word of the linear combination label, is the reverse representation of the context word of the linear combination label, is the positive representation of the document representation of all labels, is the transposed matrix of the forward text representation, is the reverse representation of the document representation of all labels, Represented as the transposed matrix of the reverse text representation.