A method, device and medium for classifying maritime and commercial long texts based on fusion features

By using the fusion feature extraction method of the BERT pre-training model and the attention mechanism in maritime long text classification, the problem of poor long text classification in the existing technology is solved, and the classification accuracy and efficiency are improved.

CN114564943BActive Publication Date: 2024-09-17NANJING UNIV OF INFORMATION SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111518907.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-13
Publication Date
2024-09-17
Estimated Expiration
2041-12-13

AI Technical Summary

Technical Problem

The existing technology has the problems of high-dimensional sparsity, disorder and inability to pay attention to the text context in the classification of long maritime texts, resulting in poor classification results. Especially for long texts, traditional methods ignore the hierarchical structure of the document. information, affecting classification accuracy.

Method used

The fusion feature extraction method based on the BERT pre-training model is used to divide the long text into small pieces of text, extract local and global features through the convolutional neural network and the bidirectional long short-term memory network, and introduce the attention mechanism to generate the final probability expression to achieve Classification.

Benefits of technology

It reduces the complexity of text representation, overcomes the limitations of global vector representation in long text classification, improves classification accuracy, and achieves efficient classification of long maritime texts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114564943B
    Figure CN114564943B
Patent Text Reader

Abstract

The present invention provides a method, device and medium for classifying long maritime and shipping texts based on fusion features. The method comprises: firstly, segmenting the preprocessed long text, and sending the segmented small texts into the BERT pre-training model respectively to obtain the word vector and sentence vector containing the local text. Secondly, the word vector is sent into the convolutional neural network to generate the feature vector of the local text, and the feature vector of the local text and the BERT sentence vector are fused as the final sentence vector of the local text. Then, the sentence vectors of the n groups of texts fused after the long text is divided are input into the bidirectional long short-term memory network to extract the global information of the text. Finally, by introducing the attention mechanism to focus on the key points, softmax is used to obtain the final probability expression of the long text, thereby improving the classification efficiency and accuracy of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method, device and medium for classifying maritime and shipping long texts based on fusion features, and belongs to the technical field of natural language processing. Background Art

[0002] With the continuous deepening of the reform of my country's judicial system, a large number of judicial documents have been made public by major courts through the Internet. However, the lack of document category labels has made it difficult for legal personnel to search for massive judicial text information resources. How to quickly and efficiently automate the classification of ruling documents is an urgent problem to be solved.

[0003] Judgment document classification belongs to the category of text classification. As one of the most classic and basic tasks in the field of Natural Language Processing (NLP), text classification is widely used in the fields of topic classification, sentiment analysis, and question-answer matching. According to the pre-set category labels, the text is automatically classified by extracting the high-level features of the text. Text classification can be roughly divided into two types of methods: shallow learning machine learning methods and deep learning-based methods. Shallow learning text classification methods extract word frequency or bag-of-words features, and then send the text features to classification models such as Naive Bayes (NB) and Support Vector Machine (SVM) to predict category labels. Since traditional machine learning algorithms are shallow feature extraction, they have the disadvantages of high-dimensional sparsity, disorder, and inability to connect the context of the text, which limits the classification effect of traditional text classification models.

[0004] Kim made some changes to the input layer of Convolutional Neural Networks (CNN) and proposed a text classification model TextCNN. The TextCNN model contains a convolution layer and a maximum pooling layer. The model has a small number of parameters and a fast training speed, but the field of view of its convolution kernel is controlled by the convolution kernel. The convolution kernel of a fixed size can only extract local features and cannot focus on features with a longer field of view. Liu et al. used the Long Short-Term Memory (LSTM) network to model the sequence information of sentences and used the last state of the network as a text representation. For short texts, recurrent neural networks have a good performance. As the length of the text becomes longer, the interval between sequence data will increase, which will weaken the memory of the long short-term memory network. For long texts, directly inputting the document as a long sequence into the model will not only bring challenges to the performance of the model, but also ignore the hierarchical structure information of the document. Summary of the invention

[0005] The purpose of the present invention is to overcome the deficiencies in the prior art and to provide a method, device and medium for classifying maritime and commercial long texts based on fusion features, which can classify maritime and commercial long texts more accurately.

[0006] To achieve the above object, the present invention is implemented by adopting the following technical solutions:

[0007] In a first aspect, the present invention provides a method for classifying maritime and shipping long texts based on fusion features, comprising the following steps:

[0008] Get the long text of maritime affairs to be classified;

[0009] Segment the long maritime and shipping texts to be classified to obtain the divided small texts;

[0010] Send the divided small text segments into the BERT pre-training model to obtain the word vector and BERT sentence vector of the local text;

[0011] The word vector is sent to the convolutional neural network to generate the feature vector of the local text, and the feature vector of the local text and the BERT sentence vector are combined as the final sentence vector of the local text;

[0012] The final sentence vector of each local text is input into the bidirectional long short-term memory network to extract the global information of the text;

[0013] By introducing the attention mechanism to focus on the key points, the softmax function is used to obtain the final probabilistic expression of the long text, that is, the classification result of the maritime and shipping long text.

[0014] Furthermore, the method of segmenting the long maritime and shipping text to be classified to obtain the segmented small texts includes:

[0015] Text segmentation is performed according to the hierarchical structure of long texts, dividing long texts into multiple short sentences and retaining the global information of the text.

[0016] Furthermore, the divided small text segments are respectively fed into the BERT pre-training model, and the method of obtaining the word vector and BERT sentence vector of the local text includes:

[0017] Add BERT special tags to both ends of the divided text segments;

[0018] The input information of the BERT encoder is obtained by adding and fusing the word embedding, sentence embedding, and position embedding of the divided small text segments;

[0019] The input information of the BERT encoder is encoded through multiple bidirectional Transformer encoders to obtain the word vector and BERT sentence vector of the local text.

[0020] Furthermore, the convolutional neural network includes an input layer, a convolution layer, a pooling layer, and a fusion layer;

[0021] The input layer is an n×k matrix composed of word vectors of local text, where n is the number of words in the local text and k represents the dimension of the word vector;

[0022] Each row of the input layer is a k-dimensional word vector corresponding to a word;

[0023] The convolution layer performs feature extraction by using multiple groups of convolution kernels of different sizes;

[0024] The pooling layer is used to reduce the dimension of the result of the convolution layer, and the features extracted by the convolution layer are pooled into one feature value using maximum pooling;

[0025] The fusion layer is used to concatenate and fuse the feature values ​​obtained by the pooling layer to form a feature vector of the local text.

[0026] Furthermore, the method of fusing the feature vector of the local text and the BERT sentence vector as the final sentence vector of the local text includes:

[0027] The two one-dimensional vectors, the feature vector of the local text and the BERT sentence vector, are reshaped into the one-dimensional final sentence vector of the local text by concatenating the vectors end to end.

[0028] Furthermore, the bidirectional long short-term memory network extracts global information of the text by controlling the cell state through three gates, namely, a forget gate, an input gate, and an output gate;

[0029] The bidirectional long short-term memory network receives the final sentence vectors of the local texts in chronological order, and inputs the final sentence vectors of multiple groups of local texts into multiple hidden layers of the bidirectional long short-term memory network respectively; the bidirectional long short-term memory network associates multiple groups of local information of the entire group of texts to extract the global information of the texts;

[0030] The forget gate is used to determine how much of the unit state at the previous moment is retained to the current moment;

[0031] The input gate is used to determine how much of the network input is saved to the unit state at the current moment;

[0032] The output gate is used to control how much of the cell state is output to the current output value of the long short-term memory network.

[0033] Furthermore, by introducing the attention mechanism to focus on the key points, the method of using the softmax function to obtain the final probability expression of the long text includes:

[0034] The attention weights of the hidden layer outputs of the bidirectional long short-term memory network at each moment are calculated and normalized. The larger the weight value, the greater the impact of the local information on the classification accuracy.

[0035] Perform weighted summation on the output features at each moment to obtain the final text vector;

[0036] The category with the maximum probability is calculated by the softmax function as the classification result of the maritime and shipping long text.

[0037] In a second aspect, the present invention provides a maritime and shipping long text classification device based on fusion features, comprising:

[0038] Acquisition module: used to obtain the long text of maritime affairs and commercial affairs to be classified;

[0039] Segmentation module: used to segment the long maritime and shipping text to be classified and obtain the divided small text segments;

[0040] Word embedding layer module: used to send the divided small text segments into the BERT pre-training model to obtain the word vector and BERT sentence vector of the local text;

[0041] CNN layer module: used to send word vectors into the convolutional neural network to generate feature vectors of local texts, and fuse the feature vectors of local texts and BERT sentence vectors as the final sentence vectors of local texts;

[0042] Bi-LSTM layer module: used to input the final sentence vector of each local text into the bidirectional long short-term memory network to extract the global information of the text;

[0043] Attention layer module: It is used to focus on the key points by introducing the attention mechanism and adopt the softmax function to obtain the final probabilistic expression of the long text, that is, the classification result of the maritime and shipping long text.

[0044] In a third aspect, the present invention provides a maritime and shipping long text classification device based on fusion features, comprising a processor and a storage medium;

[0045] The storage medium is used to store instructions;

[0046] The processor is used to operate according to the instructions to execute the steps of the method according to the first aspect.

[0047] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the steps of the method described in the first aspect.

[0048] Compared with the prior art, the present invention has the following beneficial effects:

[0049] 1. The patent of the present invention adopts a method of segmenting long maritime and commercial texts to obtain divided small text segments, thereby reducing the complexity of the text representation stage.

[0050] 2. The present invention adopts the most advanced pre-trained language representation model BERT and the masked language model pre-training objective function to deal with the unidirectional limitation faced by the previous model, thereby generating a deep bidirectional language representation.

[0051] 3. The present invention overcomes the problem that the current long text classification algorithm only uses the global target vector in the text vector representation and ignores the obvious semantic features of the text. It proposes a feature-fused long text classification model that fuses the feature vector of the local text and the BERT sentence vector as the final sentence vector of the local text. Compared with the existing long text classification algorithms, this algorithm has a higher classification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 This is the structure diagram of the segmented attention long text fusion model of the patent of this invention;

[0053] Figure 2 Schematic diagram for word embedding construction;

[0054] Figure 3 Schematic diagram of convolutional neural network;

[0055] Figure 4 Schematic diagram of the LSTM unit structure. DETAILED DESCRIPTION

[0056] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.

[0057] Embodiment 1:

[0058] This embodiment provides a method for classifying maritime and shipping long texts based on fusion features, the method comprising:

[0059] First, obtain the long maritime and shipping text to be classified, segment the long maritime and shipping text to be classified, and send the segmented small segments to the BERT pre-training model to obtain the word vector and sentence vector containing the local text;

[0060] Secondly, the word vector is sent to the Convolutional Neural Network (CNN) to generate the feature vector of the local text, and the feature vector of the local text and the BERT sentence vector are fused as the final sentence vector of the local text;

[0061] Then, the sentence vectors of the n groups of texts fused after the long text is divided are input into the Bi-directional Long Short-Term Memory (Bi-LSTM) network to extract the global information of the text;

[0062] Finally, by introducing the attention mechanism to focus on the key points, softmax is used to obtain the final probabilistic expression of the long text, thereby improving the classification efficiency and accuracy of the model.

[0063] The method of this embodiment overcomes the problem that the current long text classification algorithm only uses the global target vector in the text vector representation and ignores the obvious semantic features of the text, and proposes a long text classification model with fused features. Compared with the existing long text classification algorithms, this algorithm has a higher classification accuracy.

[0064] Specifically, the method of this embodiment specifically proposes a long text classification model, such as Figure 1 As shown, it mainly includes word embedding layer, CNN layer, Bi-LSTM layer, and attention layer. Since the data set studied in this patent is a long text of maritime and commercial judicial documents, the text is relatively long, which is much longer than the maximum input sequence length of BERT. If the text is truncated to meet the BERT requirements for the input sequence length, a large amount of text information will be lost, reducing the accuracy of classification. If the length of the position embedding is increased and pre-training is started again from scratch, on the one hand, a large amount of hardware resources will be consumed; on the other hand, since the computational complexity increases with the square of the length of the input text, a lot of computing time will be consumed. Therefore, this patent adopts the method of dividing the long text into multiple short sentences to retain the global information of the text.

[0065] Specifically, the method is based on the model and includes the following steps:

[0066] Step 1: Get the long text of the maritime and shipping documents to be classified.

[0067] Step 2: Segment the long text into multiple short sentences according to its hierarchical structure, retaining the global information of the text.

[0068] Step 3: Send the divided small segments of text into the BERT pre-training model to obtain the word vector and sentence vector of the local text.

[0069] Specifically, the BERT pre-trained language model is used as the word embedding layer to learn the text representation of the judicial documents. BERT special tags are added to both ends of the divided document content. [CLS] indicates the classification of the sentence, and [SEP] indicates the end of the sentence. The judicial text X is obtained by adding and fusion of the token embeddings, segment embeddings, and position embeddings to obtain the input information of the BERT encoder. The process is as follows: Figure 2 As shown;

[0070] After encoding through multiple bidirectional Transformer encoders, the vector representation of the text is obtained. Since [CLS] is at the beginning of the sentence, its corresponding final hidden state will represent the sentence vector of the input text, denoted by L∈R H ; The word vector corresponding to the i-th word is denoted as T i ∈R H ;

[0071] Step 4: Send the word vector to the Convolutional Neural Network (CNN) to generate the feature vector of the local text. The convolutional neural network consists of an input layer, a convolution layer, a pooling layer, and a fusion layer. Figure 3 As shown. The input layer is an n×k matrix composed of word vectors corresponding to the ruling document, where n is the number of words in the local text and k is the dimension of the word vector. Each row of the input layer is a k-dimensional word vector corresponding to a word. The convolution layer extracts features by using multiple groups of convolution kernels of different sizes. There are m convolution kernels of each size, where m is a natural number greater than or equal to 1. The pooling layer reduces the dimension of the result of the convolution layer to reduce overfitting and improve the robustness of the extracted features. The features after pooling of different convolution kernels are fused to form the feature vector of the local text. The feature vector of the local text and the BERT sentence vector are fused as the final sentence vector of the local text.

[0072] Specifically, the convolutional neural network includes an input layer, a convolution layer, a pooling layer, and a fusion layer; the input layer is an n×k matrix composed of word vectors of local text, where n is the number of words in the local text and k represents the dimension of the word vector; each row of the input layer is a k-dimensional word vector corresponding to a word; the convolution layer extracts features by using multiple groups of convolution kernels of different sizes; the pooling layer is used to reduce the dimension of the result of the convolution layer, and uses maximum pooling to pool the features extracted by the convolution layer into a feature value; the fusion layer is used to concatenate and fuse the feature values ​​obtained by the pooling layer to form a feature vector of the local text.

[0073] Specifically, the method of fusing the feature vector of the local text and the BERT sentence vector as the final sentence vector of the local text includes: reshaping the two one-dimensional vectors, the feature vector of the local text and the BERT sentence vector, into a one-dimensional final sentence vector of the local text by concatenating the vectors end to end.

[0074] Step 5: Input the sentence vectors of the n groups of text fusion after the long text is divided into two groups into a bidirectional long short-term memory network (Bi-directional Long Short-Term Memory, Bi-LSTM) to extract the global information of the text. The unit structure of LSTM is as follows Figure 4 As shown, the cell state is controlled by three gates, namely the forget gate, input gate, and output gate.

[0075] Specifically, the bidirectional long short-term memory network extracts the global information of the text by controlling the cell state with three gates, namely the forget gate, input gate, and output gate;

[0076] The bidirectional long short-term memory network receives the final sentence vectors of the local text in chronological order, and inputs the final sentence vectors of multiple groups of local texts into multiple hidden layers of the bidirectional long short-term memory network respectively; the bidirectional long short-term memory network associates multiple groups of local information of the entire group of texts to extract the global information of the text;

[0077] The forget gate is used to determine how much of the unit state at the previous moment is retained at the current moment;

[0078] The input gate is used to determine how much of the network input is saved to the unit state at the current moment;

[0079] The output gate is used to control how much of the cell state is output to the current output value of the LSTM network.

[0080] Step 6: By introducing the attention mechanism to focus on the key points, softmax is used to obtain the final probability expression of long text classification, that is, the classification result of maritime and commercial long text, to improve the classification efficiency and accuracy of the model.

[0081] Specifically, the attention weights of the hidden layer outputs of the bidirectional long short-term memory network at each moment are calculated and normalized. The larger the weight value, the greater the impact of the local information on the classification accuracy. The output features at each moment are weighted and summed to obtain the final text vector. Finally, the category with the maximum probability is calculated by the softmax function as the classification result of the maritime long text.

[0082] Specifically, the classification results of the long maritime text to be classified are the five major categories of maritime: maritime preservation requests, maritime contract disputes, other maritime disputes, maritime execution, and maritime tort disputes.

[0083] The classification method of this embodiment outputs the category to which it belongs, which is equivalent to labeling all the documents in the database. This classification method is to improve the search speed and reduce the consumption of search resources in subsequent specific search applications. For example, if you want to search for contract disputes, you do not need to search the entire database, but can directly search for maritime contract disputes, which will greatly reduce the time consumption of search and improve the user experience.

[0084] This embodiment adopts the method of segmenting the long maritime and shipping text to obtain the segmented small text segments, which realizes the reduction of the complexity of the text representation stage from O(n 2 ) Reduced to O(ns) , O() represents the complexity, where n Indicates the length of the input text. s Indicates the length of the divided small block of text.

[0085] The classification method of this embodiment adopts the most advanced pre-trained language representation model BERT, and uses a masked language model pre-training objective function to deal with the unidirectional limitation faced by the previous model, thereby generating a deep bidirectional language representation.

[0086] The classification method of this embodiment overcomes the problem that the current long text classification algorithm only uses the global target vector in the text vector representation and ignores the obvious semantic features of the text. A feature-fused long text classification model is proposed, which fuses the feature vector of the local text and the BERT sentence vector as the final sentence vector of the local text. Compared with the existing long text classification algorithms, this algorithm has a higher classification accuracy.

[0087] Embodiment 2:

[0088] This embodiment provides a maritime and shipping long text classification device based on fusion features, including:

[0089] Acquisition module: used to obtain the long text of maritime affairs and commercial affairs to be classified;

[0090] Segmentation module: used to segment the long maritime and shipping text to be classified and obtain the divided small text segments;

[0091] Word embedding layer module: used to send the divided small text segments into the BERT pre-training model to obtain the word vector and BERT sentence vector of the local text;

[0092] CNN layer module: used to send word vectors into the convolutional neural network to generate feature vectors of local texts, and fuse the feature vectors of local texts and BERT sentence vectors as the final sentence vectors of local texts;

[0093] Bi-LSTM layer module: used to input the final sentence vector of each local text into the bidirectional long short-term memory network to extract the global information of the text;

[0094] Attention layer module: It is used to focus on the key points by introducing the attention mechanism and adopt the softmax function to obtain the final probabilistic expression of the long text, that is, the classification result of the maritime and shipping long text.

[0095] The device of this embodiment can implement the method of the first embodiment.

[0096] Embodiment three:

[0097] The embodiment of the present invention also provides a maritime and shipping long text classification device based on fusion features, including a processor and a storage medium;

[0098] The storage medium is used to store instructions;

[0099] The processor is used to operate according to the instructions to execute the steps of the following method:

[0100] First, obtain the long maritime and shipping text to be classified, segment the long maritime and shipping text to be classified, and send the segmented small segments to the BERT pre-training model to obtain the word vector and sentence vector containing the local text;

[0101] Secondly, the word vector is sent to the Convolutional Neural Network (CNN) to generate the feature vector of the local text, and the feature vector of the local text and the BERT sentence vector are fused as the final sentence vector of the local text;

[0102] Then, the sentence vectors of the n groups of texts fused after the long text is divided are input into the Bi-directional Long Short-Term Memory (Bi-LSTM) network to extract the global information of the text;

[0103] Finally, by introducing the attention mechanism to focus on the key points, softmax is used to obtain the final probabilistic expression of the long text, thereby improving the classification efficiency and accuracy of the model.

[0104] Embodiment 4:

[0105] The embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the following method are implemented:

[0106] First, obtain the long maritime and shipping text to be classified, segment the long maritime and shipping text to be classified, and send the segmented small segments to the BERT pre-training model to obtain the word vector and sentence vector containing the local text;

[0107] Secondly, the word vector is sent to the Convolutional Neural Network (CNN) to generate the feature vector of the local text, and the feature vector of the local text and the BERT sentence vector are fused as the final sentence vector of the local text;

[0108] Then, the sentence vectors of the n groups of texts fused after the long text is divided are input into the Bi-directional Long Short-Term Memory (Bi-LSTM) network to extract the global information of the text;

[0109] Finally, by introducing the attention mechanism to focus on the key points, softmax is used to obtain the final probabilistic expression of the long text, thereby improving the classification efficiency and accuracy of the model.

[0110] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0111] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0112] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0113] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0114] The above are only preferred embodiments 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 technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A maritime and shipping long text classification method based on fusion features, characterized in that: The following steps are involved: Get the long text of maritime affairs to be classified; Segment the long maritime and shipping texts to be classified to obtain the divided small texts; Send the divided small text segments into the BERT pre-training model to obtain the word vector and BERT sentence vector of the local text; The word vector is sent to the convolutional neural network to generate the feature vector of the local text, and the feature vector of the local text and the BERT sentence vector are combined as the final sentence vector of the local text; The final sentence vector of each local text is input into the bidirectional long short-term memory network to extract the global information of the text; By introducing the attention mechanism to focus on the key points, the softmax function is used to obtain the final probabilistic expression of the long text, that is, the classification result of the maritime and shipping long text.

2. The maritime and shipping long text classification method based on fusion features according to claim 1 is characterized in that: The method of segmenting the long maritime and commercial text to be classified and obtaining the segmented small texts includes: Text segmentation is performed according to the hierarchical structure of long texts, dividing long texts into multiple short sentences and retaining the global information of the text.

3. The maritime and shipping long text classification method based on fusion features according to claim 1 is characterized in that: The divided small text segments are fed into the BERT pre-training model respectively. The method of obtaining the word vector and BERT sentence vector of the local text includes: Add BERT special tags to both ends of the divided text segments; The input information of the BERT encoder is obtained by adding and fusing the word embedding, sentence embedding, and position embedding of the divided small text segments; The input information of the BERT encoder is encoded through multiple bidirectional Transformer encoders to obtain the word vector and BERT sentence vector of the local text.

4. The maritime and shipping long text classification method based on fusion features according to claim 1 is characterized in that: The convolutional neural network includes an input layer, a convolution layer, a pooling layer, and a fusion layer; The input layer is composed of word vectors corresponding to the ruling documents. Matrix, where n is the number of words in the local text, k Represents the dimension of the word vector; Each row of the input layer corresponds to a word k Dimensional word vector; The convolution layer performs feature extraction by using multiple groups of convolution kernels of different sizes; The pooling layer is used to reduce the dimension of the result of the convolution layer, and the features extracted by the convolution layer are pooled into one feature value using maximum pooling; The fusion layer is used to concatenate and fuse the feature values ​​obtained by the pooling layer to form a feature vector of the local text.

5. The maritime and shipping long text classification method based on fusion features according to claim 1 is characterized in that: Methods for fusing the feature vector of a local text and the BERT sentence vector as the final sentence vector of the local text include: The two one-dimensional vectors, the feature vector of the local text and the BERT sentence vector, are reshaped into the one-dimensional final sentence vector of the local text by concatenating the vectors end to end.

6. The maritime and shipping long text classification method based on fusion features according to claim 1 is characterized in that: The bidirectional long short-term memory network extracts global information of the text and controls the cell state by three gates, namely the forget gate, the input gate, and the output gate; The bidirectional long short-term memory network receives the final sentence vectors of the local texts in chronological order, and inputs the final sentence vectors of multiple groups of local texts into multiple hidden layers of the bidirectional long short-term memory network respectively; the bidirectional long short-term memory network associates multiple groups of local information of the entire group of texts to extract global information of the texts; The forget gate is used to determine how much of the unit state at the previous moment is retained to the current moment; The input gate is used to determine how much of the network input is saved to the unit state at the current moment; The output gate is used to control how much of the cell state is output to the current output value of the long short-term memory network.

7. The maritime and shipping long text classification method based on fusion features according to claim 6 is characterized in that: By introducing the attention mechanism to focus on the key points, the methods of using the softmax function to obtain the final probability expression of long texts include: The attention weights of the hidden layer outputs of the bidirectional long short-term memory network at each moment are calculated and normalized. The larger the weight value, the greater the impact of the local information on the classification accuracy. Perform weighted summation on the output features at each moment to obtain the final text vector; The category with the maximum probability is calculated by the softmax function as the classification result of the maritime and shipping long text.

8. A maritime and commercial long text classification device based on fusion features, characterized in that: include: Acquisition module: used to obtain the long text of maritime affairs and commercial affairs to be classified; Segmentation module: used to segment the long maritime and shipping text to be classified and obtain the divided small text segments; Word embedding layer module: used to send the divided small text segments into the BERT pre-training model to obtain the word vector and BERT sentence vector of the local text; CNN layer module: used to send word vectors into the convolutional neural network to generate feature vectors of local texts, and fuse the feature vectors of local texts and BERT sentence vectors as the final sentence vectors of local texts; Bi-LSTM layer module: used to input the final sentence vector of each local text into the bidirectional long short-term memory network to extract the global information of the text; Attention layer module: It is used to focus on the key points by introducing the attention mechanism and adopt the softmax function to obtain the final probabilistic expression of the long text, that is, the classification result of the maritime and shipping long text.

9. A maritime and commercial long text classification device based on fusion features, characterized in that: including processor and storage medium; The storage medium is used to store instructions; The processor is used to operate according to the instructions to execute the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented.