A classification method using a text content classification system based on a BERT model

Through the text content classification system based on the BERT model, combined with the MatrixCNN model, the limitations of the natural language processing model in capturing contextual relationships and generalization capabilities are solved, achieving higher classification accuracy and stability, and adapting to different fields and scenarios. classification task.

CN118332387BActive Publication Date: 2024-09-17QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410748775.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-09-17
Estimated Expiration
2044-06-12

AI Technical Summary

Technical Problem

Existing natural language processing models have limitations in capturing the dependencies between words, the logical connections between sentences, and the overall contextual relationship of the text. They also have insufficient generalization capabilities and are difficult to adapt to classification tasks in different fields and scenarios.

Method used

Using a text content classification system based on the BERT model, through data preprocessing, semantic feature extraction, dimensionality upgrading and normalization processing, the text is input into the MatrixCNN model, and the convolutional layer, residual layer, pooling layer and fully connected layer are used to spatially Dimensionally understand the dependencies between words and the logical connections between sentences to improve classification accuracy.

Benefits of technology

Through dimensionality upgrading and normalization processing, the expressive ability of text semantic features is enhanced, the classification accuracy and the stability of the model are improved, ensuring good classification effects in different fields and scenarios, and data preprocessing is used to reduce noise interference and improve Improve model training efficiency and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118332387B
    Figure CN118332387B
Patent Text Reader

Abstract

The present invention discloses a classification method using a text content classification system based on a BERT model, which relates to the technical field of natural language processing, and comprises the following steps: S1: data preprocessing is performed on the text to be classified, and the preprocessed text is input into the BERT model according to the sequence X={x1,x2,x3,…,xn}; S2: semantic-level feature extraction is performed on the text content using the BERT model pre-training weights; S3: dimension-upgrading is performed on the obtained text feature vector set V. The present invention solves the problem that the existing model cannot fully understand the dependency relationship between words, the logical connection between sentences, and the overall context relationship of the text, and solves the problem of text content classification in different languages ​​from a system level.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and in particular to a classification method for a text content classification system using a BERT model. Background Art

[0002] In recent years, deep learning technology has made breakthrough progress in the field of natural language processing. Deep learning models, such as convolutional neural networks (CNN), recurrent neural networks (RNN), and Transformer, can automatically learn deep feature representations of text and effectively process sequence data. In classification tasks, deep learning models can capture the semantic information and contextual relationships of text, improving the accuracy and robustness of classification. In addition, with the development of big data and cloud computing technologies, the application scenarios of natural language processing classification are becoming more and more extensive. Whether in news classification, sentiment analysis, spam identification, or product review classification, natural language processing classification plays an important role. These applications not only improve the efficiency of information processing, but also provide strong support for the field of decision support.

[0003] Although significant progress has been made in the field of natural language processing classification, there are still some problems and challenges. First, existing natural language processing models still have certain limitations in capturing contextual relationships. The models may not fully understand the dependencies between words, the logical connections between sentences, and the overall structure of the text, resulting in inaccurate classification results. Secondly, the generalization ability of the model is also an issue that needs attention. Due to the diversity and variability of text data, classification models are often difficult to adapt to new fields or scenarios. How to improve the generalization ability of the model so that it can achieve good classification results in different fields and scenarios is an issue that needs to be solved urgently. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a classification method for a text content classification system based on the BERT model, to solve the problem that the existing model cannot fully understand the dependency relationship between words, the logical connection between sentences and the overall context of the text, and to solve the problem of text content classification in different languages ​​from a system level.

[0005] The present invention adopts the following technical solutions to achieve the invention objectives:

[0006] A classification method using a text content classification system based on a BERT model, characterized by comprising the following steps:

[0007] S1: Perform data preprocessing on the text to be classified, and input the preprocessed text into the BERT model in the sequence X={x1,x2,x3,…,xn};

[0008] S2: Use the BERT model pre-trained weights to extract semantic-level features from text content;

[0009] S3: Upgrading the dimension of the obtained text feature vector set V;

[0010] S4: The semantic feature representation matrix M of the text is normalized;

[0011] S5: Input M` into the MatrixCNN model for classification processing, so that the model can understand the dependency relationship between words, the logical connection between sentences, and the overall context of the text in the spatial dimension, thereby improving the accuracy of classification.

[0012] As a further limitation of the technical solution, the specific steps of S1 are:

[0013] S11: Segment the text to be classified, tag the parts of speech, and remove stop words;

[0014] S12: Determine whether the length of the text to be classified after step S11 exceeds the maximum length of the BERT model;

[0015] If the length of the text exceeds the maximum input length of the BERT pre-trained model, the truncation algorithm is used to truncate the text content, and the truncation text sequences X1={x1,x2,x3,…,xu}, X2={xu+1,xu+2,xu+3,…,xm}, X3={xm+1,xm+2,xm+3,…,xn} are input into the BERT pre-trained model in sequence;

[0016] S13: If the text length does not exceed the maximum input length of the BERT pre-trained model, the text processed in step S11 is directly input into the BERT pre-trained model.

[0017] As a further limitation of the technical solution, the specific steps of S2 are:

[0018] S21: Prepare relevant prediction libraries for the fields to be classified;

[0019] S22: Input the corpus into the BERT baseline model for fine-tuning training to obtain pre-trained weights. Use the BERT model to load the pre-trained weights to process the text sequence X={x1,x2,x3,…,xn}. The resulting text feature vector set V={v1,v2,v3,…,vn} has stronger representation capabilities in the field to be classified.

[0020] As a further limitation of the present technical solution, the specific steps of S3 are:

[0021] Arrange the word vectors in the text feature vector set V = {v1, v2, v3, …, vn} in the order of the text sequence words from top to bottom according to the order of the words in the text to form a two-dimensional matrix M of feature vectors, and call M the semantic feature representation matrix of the text. The shape of M is n * dim;

[0022] After dimensionality increase, abstract the dependency relationship between words, the logical connection between sentences, and the overall context relationship of the text as the row spacing between adjacent rows or adjacent multiple rows in M.

[0023] As a further limitation of this technical solution, the specific steps of S4 are as follows:

[0024] S41: Take the maximum value of the first dimension in the semantic feature representation matrix M of the text in each batch as the normalization benchmark L;

[0025] S42: For M that does not meet the dimension length, perform a replication filling operation, which can not only meet the requirement of the input dimension consistency of the fully connected layer, but also play a role in semantic enhancement;

[0026] The strategy of the filling operation is replication filling, that is, start filling from the first row of M to the blank rows in sequence until the benchmark length L is filled. If the number of rows of M is not enough to fill to the benchmark L, start filling from the first row and continue to fill until the benchmark length L is filled.

[0027] As a further limitation of this technical solution, the specific steps of S5 are as follows:

[0028] The first layer of the input is a convolutional layer. Perform convolution operations on the input text matrix through multiple convolutional kernels of different sizes to extract local features of the text, and then input to the second layer;

[0029] Define multiple convolutional kernels in this layer. The size of the convolutional kernel is: [a1, a2, a3, …, am] * dim (a1 < a2 < a3 < … < am), where a1, a2, a3, …, am are the lengths of the defined convolutional kernels, and the width of the convolutional kernel is fixed at dim; Perform convolution operations on M` with a stride of 1 to extract local features and obtain multiple feature maps f1, f2, f3, …, fm, and the dimension of any one feature map is L - an + 1;

[0030] S52: The second layer of the input is a padding and splicing layer. Pad the feature maps with different dimensions to be the same and then splice them to obtain new global features from the local features, and then input to the third layer;

[0031] This layer fills the channels of multiple feature maps f1, f2, f3, ..., fm in the second dimension to L-a1+1, and obtains f1`, f2`, f3`, ..., fm`. It concatenates f1`, f2`, f3`, ..., fm` in the second dimension to form a new feature map , forming more representative global features;

[0032] S53: The third input layer is a residual layer, and the concatenated feature map is passed through multiple residual blocks to further extract local features, and then input into the fourth layer;

[0033] This layer defines multiple residual blocks. Through multiple residual blocks, local features are further extracted;

[0034] Each residual block consists of two layers of two-dimensional convolution and batch normalization, and a ReLu activation function is performed after each layer of convolution. ReLu activation is used between multiple residual blocks;

[0035] S54: The fourth input layer is a pooling layer, which is used to compress the dimension of the feature map and extract important features, and then input into the fifth layer;

[0036] S55: The fifth input layer is a fully connected layer, which connects the output of the pooling layer to one or more fully connected layers for learning the relationship between features and performing final classification. Finally, it enters the output layer and outputs the text category corresponding to the category index with the largest probability value.

[0037] As a further limitation of the present technical solution, the calculation process of batch normalization is as follows:

[0038] Standardization: First, standardize the data of each batch. For the input data, its mean and variance is calculated on the current batch:

[0039] (1)

[0040] in: is the i-th element in the input data;

[0041] is the size of the current batch;

[0042] is the mean of the current batch;

[0043] is the variance of the current batch;

[0044] Then, standardize:

[0045] (2)

[0046] in: is a small constant used to avoid division by zero errors;

[0047] is the standardized data;

[0048] Scaling and translation: Batch normalization introduces two learnable parameters and to scale and translate the normalized data:

[0049] (3)

[0050] in: and are the parameters learned through back-propagation;

[0051] It is the output after Batch Normalization;

[0052] The formula of the Relu activation function is:

[0053] (4);

[0054] in: is the output of the hidden layer, which is the input of the Relu function.

[0055] As a further limitation of the present technical solution, the text content classification system based on the BERT model includes:

[0056] Data preprocessing layer;

[0057] BERT pre-trained model layer;

[0058] Text semantic feature dimension-enhancing layer;

[0059] Normalization layer of sentence feature matrix;

[0060] MatrixResCNN model layers: Contains convolutional layers, residual layers, pooling layers, fully connected layers, and output layers.

[0061] Compared with the prior art, the advantages and positive effects of the present invention are: the present invention improves the expressive power of text semantic features by upgrading the dimension of text semantic features, so that the upgraded text semantic features contain more dependencies between words, logical connections between sentences and contextual relationships between the whole, and constructs a MatrixResCNN model through a convolutional layer, a residual layer, a pooling layer and a fully connected layer. By increasing the network depth, the model understands the dependencies between words, the logical connections between sentences and the overall structure of the text in the spatial dimension, and explores deeper semantics, improves the accuracy of text content classification, and finally outputs the classification result by the output layer. The present invention uses the unique truncation algorithm of the system in the data preprocessing layer to enable the system to ensure that all text inputs have the same length, which is convenient for model processing, and the format of the preprocessed text data is unified, which improves the efficiency and stability of model training, reduces the interference of noise data through cleaning and tokenization processes, and improves classification accuracy. The text feature matrix is ​​normalized in the normalization layer of the sentence feature matrix so that it has a unified scale range, reduces the scale difference between data, and improves the stability of the model. Normalization operation can accelerate the training process of the model and improve the convergence speed. The normalized data is convenient for the processing of subsequent model layers and reduces the computational complexity. The present invention forms a complete text classification process by designing a series of hierarchical structures, from data preprocessing to feature extraction, feature dimension upgrade to classification decision. Each level is carefully designed to perform different functions respectively. The hierarchical modules are independent of each other, so that the system can complete the classification task efficiently and accurately. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is a system structure framework diagram of the present invention.

[0063] Figure 2 It is an implementation flow chart of the present invention. DETAILED DESCRIPTION

[0064] A specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings, but it should be understood that the protection scope of the present invention is not limited by the specific implementation.

[0065] The present invention comprises the following steps:

[0066] S1: Perform data preprocessing on the text to be classified, and input the preprocessed text into the BERT model in the sequence X={x1,x2,x3,…,xn}.

[0067] The specific steps of S1 are:

[0068] S11: Segment the text to be classified, tag the parts of speech, and remove stop words;

[0069] S12: Determine whether the length of the text to be classified after step S11 exceeds the maximum length of the BERT model (the BERT model requires that the length of the input content does not exceed 512);

[0070] If the length of the text exceeds the maximum input length of the BERT pre-trained model, the truncation algorithm is used to truncate the text content, and the truncation text sequences X1={x1,x2,x3,…,xu}, X2={xu+1,xu+2,xu+3,…,xm}, X3={xm+1,xm+2,xm+3,…,xn} are input into the BERT pre-trained model in sequence;

[0071] The strategy adopted by the truncation algorithm (Split) is the longest truncation strategy. Given a maximum length max_long, the backtracking method is used to find the last period as the truncation position within this length, ensuring the integrity of the text content while meeting the maximum length.

[0072] S13: If the text length does not exceed the maximum input length of the BERT pre-trained model, the text processed in step S11 is directly input into the BERT pre-trained model.

[0073] S2: Use the BERT model pre-trained weights to extract semantic-level features from text content.

[0074] The sequence X={x1,x2,x3,…,xn} is processed using the BERT model pre-trained weights to obtain a text feature vector set V={v1,v2,v3,…,vn}, where v1,v2,v3,…,vn are semantic vector representations of each word, and the dimension lengths of these vector representations are consistent, denoted as dim; the BERT model pre-trained weights are obtained by fine-tuning the BERT extreme model, that is, the BERT baseline model is fine-tuned to obtain the BERT model pre-trained weights, and the specific steps of S2 are:

[0075] S21: Prepare relevant prediction libraries for the fields to be classified;

[0076] S22: Input the corpus into the BERT baseline model for fine-tuning training to obtain pre-trained weights. Use the BERT model to load the pre-trained weights to process the text sequence X={x1,x2,x3,…,xn}. The resulting text feature vector set V={v1,v2,v3,…,vn} has stronger representation capabilities in the field to be classified.

[0077] Different pre-trained models obtained using different baseline models and corresponding data sets can extract features for different languages ​​and different fields.

[0078] S3: Upgrade the dimension of the obtained text feature vector set V.

[0079] The specific steps of S3 are:

[0080] According to the order of the words in the text sequence, the word vectors in the text feature vector set V={v1,v2,v3,…,vn} are arranged from top to bottom according to the order of the words in the text to form a two-dimensional matrix M of feature vectors. M is called the semantic feature representation matrix of the text, and the shape of M is n*dim;

[0081] After dimensionality increase, the dependency between words, the logical connection between sentences, and the overall context of the text are abstracted into spatial elements such as the spacing between adjacent lines or multiple adjacent lines in M.

[0082] S4: The semantic feature representation matrix M of the text is normalized.

[0083] Because the system needs to go through a fully connected layer before obtaining the classification result in the last layer, which requires the input dimension size to be consistent, we normalize the text semantic feature representation matrix M to form a matrix M' for subsequent processing. The specific steps of S4 are:

[0084] S41: Take the maximum value of the first dimension (i.e., n) in the semantic feature representation matrix M of the text in each batch as the normalized reference L;

[0085] S42: For M that does not meet the dimension length, copy and fill operations are performed, which can not only meet the requirements of the full connection layer and input dimension consistency, but also play a role in semantic enhancement;

[0086] S43: The strategy of the filling operation is copy filling, that is, starting from the first row of M, filling to the blank rows sequentially until the reference length L is filled. If the number of rows of M is not enough to fill the reference L, then continue filling from the first row and loop until the filling value reference length L is reached.

[0087] S5: Input M` into the MatrixCNN model for classification processing, so that the model can understand the dependency relationship between words, the logical connection between sentences, and the overall context of the text in the spatial dimension, thereby improving the accuracy of classification.

[0088] First, perform a convolution operation on the matrix M`, obtaining multiple feature maps f1, f2, f3, …, fm, and then perform padding and concatenation to further obtain the feature map f`. Conduct residual operations on f` through multiple residual blocks, which can deepen the network layer while suppressing the overfitting phenomenon. Finally, obtain the probability values of each category {type1: odds1, type2: odds2, type3: odds3, …, types: oddss} through global pooling and fully connected layers, where typei is the category index and oddsi is the probability corresponding to the category index typei. Finally, the output layer outputs the category corresponding to the category index with the largest probability value, which is the classification result. The specific steps of S5 are as follows:

[0089] S51: The first input layer is a convolutional layer. Use multiple convolutional kernels of different sizes to perform a convolution operation on the input text matrix to extract local features of the text, and then input to the second layer;

[0090] This layer defines multiple convolutional kernels with sizes: [a1, a2, a3, …, am]*dim (a1 < a2 < a3 < … < am), where a1, a2, a3, …, am are the lengths of the defined convolutional kernels, and the width of the convolutional kernel is fixed at dim; perform a convolution operation on M` with a stride of 1 to extract local features, obtaining multiple feature maps f1, f2, f3, …, fm, where the dimension of any one feature map is L - an + 1 (an is the length of the convolutional kernel).

[0091] S52: The second input layer is a padding and concatenation layer. Pad the feature maps with different dimensions to be the same and then perform concatenation to obtain new global features from local features, and then input to the third layer;

[0092] This layer pads the channels of multiple feature maps f1, f2, f3, …, fm in the second dimension to L - a1 + 1, obtaining f1`, f2`, f3`, …, fm`, and performs a concatenation operation on f1`, f2`, f3`, …, fm` in the second dimension to form a new feature map , constituting more representative global features.

[0093] S53: The third input layer is a residual layer. Pass the concatenated feature map through multiple residual blocks to further extract local features, and then input to the fourth layer;

[0094] This layer defines multiple residual blocks, and pass through multiple residual blocks to further extract local features;

[0095] Each residual block consists of two layers of two-dimensional convolution (the convolution kernel size is 3*3) and batch normalization, and a ReLu activation function is performed after each layer of convolution. ReLu activation is used between multiple residual blocks.

[0096] The calculation process of batch normalization is as follows:

[0097] Standardization: First, standardize the data of each batch. For the input data, its mean and variance is calculated on the current batch:

[0098] (1)

[0099] in: is the i-th element in the input data;

[0100] is the size of the current batch;

[0101] is the mean of the current batch;

[0102] is the variance of the current batch;

[0103] Then, standardize:

[0104] (2)

[0105] in: is a small constant used to avoid division by zero errors;

[0106] is the standardized data;

[0107] Scaling and translation: The normalized data may be constrained to a smaller range (e.g., a mean close to 0 and a variance close to 1), which may limit the representation ability of the model. Therefore, batch normalization introduces two learnable parameters and , used to scale and translate the normalized data:

[0108] (3)

[0109] in: and are the parameters learned through back-propagation;

[0110] It is the output after Batch Normalization;

[0111] The formula of the Relu activation function is:

[0112] (4);

[0113] in: is the output of the hidden layer, which is the input of the Relu function.

[0114] S54: The fourth input layer is a pooling layer, which is used to compress the dimension of the feature map and extract important features, and then input into the fifth layer.

[0115] S55: The fifth input layer is a fully connected layer, which connects the output of the pooling layer to one or more fully connected layers for learning the relationship between features and performing final classification. Finally, it enters the output layer and outputs the text category corresponding to the category index with the largest probability value.

[0116] The text content classification system based on the BERT model includes:

[0117] Data preprocessing layer;

[0118] Remove noise data such as HTML tags, special characters, and URLs from the text. Split the text into words or subword units and tokenize them. This enables the system to ensure that all text inputs have the same length, which is convenient for model processing. The format of the preprocessed text data is unified, which improves the efficiency and stability of model training. The cleaning and tokenization process reduces the interference of noise data and improves classification accuracy.

[0119] BERT pre-trained model layer;

[0120] The preprocessed text is input into the BERT model, and the deep semantic representation of the text is generated using BERT's Transformer structure. The BERT model can capture the contextual information of the text to a certain extent and generate rich semantic representations. The pre-training process also enables the BERT model to have strong generalization capabilities and can be applied to a variety of NLP tasks.

[0121] Text semantic feature dimension-enhancing layer;

[0122] The low-dimensional semantic features output by BERT are mapped to a higher-dimensional space to extract more feature information to enrich the text representation. The dimension-raising operation can capture subtle differences in the text and improve classification performance. The dimension-raising strategy can be adjusted according to specific task requirements to adapt to different classification scenarios.

[0123] Normalization layer of sentence feature matrix;

[0124] Normalize the text feature matrix to make it have a uniform scale range, reduce the scale difference between data, and improve the stability of the model. First, the normalization operation can accelerate the training process of the model and improve the convergence speed. Second, the normalized data is convenient for subsequent model layer processing and reduces the computational complexity.

[0125] MatrixResCNN model layers: Contains convolutional layers, residual layers, pooling layers, fully connected layers, and output layers.

[0126] The local features in the text are extracted through convolution operations; short-circuit connections are introduced in the residual layer to alleviate the gradient vanishing problem and enable the model to be trained deeper; the pooling layer downsamples the feature matrix to reduce the dimension and retain important features; the fully connected layer fuses local features into global features to support classification; the output layer outputs the probability that the text belongs to each category. The convolution layer can capture key information in the text and improve classification accuracy. The design of the residual layer makes the model more stable during training and can cope with complex tasks. The fully connected layer can effectively fuse local features to form a discriminative global feature representation.

[0127] BERT stands for Bidirectional Encoder Representations from Transformers, a pre-trained language model based on the Transformer architecture. It captures deep bidirectional representations of language by pre-training on large-scale text data, and then fine-tunes it for different natural language processing (NLP) tasks.

[0128] The core of the working principle of the BERT model lies in its two stages of pre-training and fine-tuning.

[0129] In the pre-training stage, BERT uses large-scale unlabeled text data to train the model and learn the contextual representation of language. The pre-training process includes two key tasks: Masked Language Model (MLM) and Next Sentence Prediction (NSP). The MLM task randomly masks a part of the words in the input sequence, and then requires the model to predict the masked words, thereby learning the relationship between the words and the context. The NSP task predicts whether two sentences are continuous, thereby learning the relationship between sentences.

[0130] The fine-tuning phase is to apply the BERT model to a specific natural language processing task. First, you need to build an input sequence for a specific task, which may include one or more sentences separated by special tags. Then, for each subword in the input sequence, use the embedding layer of the BERT model to get its corresponding vector representation, which includes word embedding, position embedding, and segment embedding. Next, add one or more task-specific fully connected layers on top of the BERT model to process relevant information for a specific task. Depending on the task, choose a suitable loss function for optimization so that the model can achieve better performance on a specific task.

[0131] The specific embodiments of the present invention are:

[0132] A1: Segment the text to be classified, tag the parts of speech, and remove stop words. Determine whether the text length exceeds the maximum BERT input value. If so, execute the Split longest truncation algorithm to truncate it. Otherwise, execute S2 directly.

[0133] A2: BERT fine-tuning pre-training model semantic feature extraction;

[0134] A3: The semantic matrix of the sentence is obtained by increasing the dimension of the text sequence words;

[0135] A4: Normalization of sentence semantic matrix;

[0136] A5: Input the MatrixCNN model for classification processing to obtain the classification result.

[0137] The above disclosure is only a specific embodiment of the present invention, but the present invention is not limited thereto, and any changes that can be conceived by those skilled in the art should fall within the protection scope of the present invention.

Claims

1. A classification method using a text content classification system based on a BERT model, characterized in that: The following steps are involved: S1: Perform data preprocessing on the text to be classified, and input the preprocessed text into the BERT model in the sequence X={x1,x2,x3,…,xn}; S2: Use the BERT model pre-trained weights to extract semantic-level features from the text content; Use the BERT model pre-trained weights to process the sequence X={x1,x2,x3,…,xn} to obtain a text feature vector set V={v1,v2,v3,…,vn}, where v1,v2,v3,…,vn are the semantic vector representations of each word, and the dimension lengths of these vector representations are consistent, denoted as dim; The BERT model pre-trained weights are obtained by fine-tuning the BERT baseline model, that is, the BERT model pre-trained weights are obtained by fine-tuning the BERT baseline model; S3: Upgrade the dimension of the obtained text feature vector set V; arrange the word vectors in the text feature vector set V={v1,v2,v3,…,vn} from top to bottom according to the order of the words in the text sequence to form a two-dimensional matrix M of feature vectors. M is called the semantic feature representation matrix of the text, and the shape of M is n*dim; S4: Normalize the text semantic feature representation matrix M. Because the system needs to go through a fully connected layer before getting the classification result in the last layer, which requires the input dimension size to be consistent, we normalize the text semantic feature representation matrix M to form a matrix M` for subsequent processing; S5: Input M` into the MatrixResCNN model for classification. The MatrixResCNN model is a classification model composed of a convolutional layer, a residual layer, a pooling layer, a fully connected layer, and an output layer. The model can understand the dependency relationship between words, the logical connection between sentences, and the overall context of the text in the spatial dimension, thereby improving the accuracy of classification.

2. The classification method according to claim 1 using a text content classification system based on a BERT model, characterized in that: The specific steps of S1 are: S11: Segment the text to be classified, tag the parts of speech, and remove stop words; S12: Determine whether the length of the text to be classified after step S11 exceeds the maximum length of the BERT model; If the length of the text exceeds the maximum input length of the BERT pre-trained model, the truncation algorithm is used to truncate the text content, and the truncation text sequences such as X1={x1,x2,x3,…,xu}, X2={xu+1,xu+2,xu+3,…,xm}, X3={xm+1,xm+2,xm+3,…,xn} are sequentially input into the BERT pre-trained model; S13: If the text length does not exceed the maximum input length of the BERT pre-trained model, the text processed in step S11 is directly input into the BERT pre-trained model.

3. The classification method according to claim 2 using a text content classification system based on a BERT model, characterized in that: The specific steps of S2 are: S21: Prepare the relevant corpus of the field to be classified; S22: Input the corpus into the BERT baseline model for fine-tuning training to obtain pre-trained weights. Use the BERT model to load these pre-trained weights to process the text sequence X = {x1, x2, x3, …, xn}, and obtain the text feature vector set V = {v1, v2, v3, …, vn}, which has stronger representation ability in the field to be classified.

4. The classification method according to claim 3 using a text content classification system based on a BERT model, characterized in that: The specific steps of S3 are as follows: Arrange the word vectors in the text feature vector set V = {v1, v2, v3, …, vn} in the order of the words in the text sequence from top to bottom to form a two-dimensional matrix M of feature vectors, and call M the semantic feature representation matrix of the text. The shape of M is n * dim; After dimensionality increase, abstract the dependency relationship between words, the logical connection between sentences, and the overall context relationship of the text as the row spacing between adjacent rows or adjacent multiple rows in M.

5. The classification method according to claim 4 using a text content classification system based on a BERT model, characterized in that: The specific steps of S4 are as follows: S41: Take the maximum value of the first dimension in the semantic feature representation matrix M of the text in each batch as the normalization benchmark L; S42: For M that does not meet the dimension length, perform a replication filling operation, which can not only meet the requirement of the input dimension consistency of the fully connected layer, but also play a role in semantic enhancement; The strategy of the filling operation is replication filling, that is, start filling from the first row of M to the blank rows in sequence until the benchmark length L is filled. If the number of rows of M is not enough to fill to the benchmark L, start filling from the first row and continue filling in a loop until the benchmark length L is filled.

6. The classification method according to claim 4 using a text content classification system based on a BERT model, characterized in that: The specific steps of S5 are as follows: S51: The first layer of the input is a convolutional layer. Perform convolution operations on the input text matrix through multiple convolutional kernels of different sizes to extract local features of the text, and then input to the second layer; Define multiple convolutional kernels in this layer. The size of the convolutional kernel is: [a1, a2, a3, …, am] * dim (a1 < a2 < a3 < … < am), where a1, a2, a3, …, am are the lengths of the defined convolutional kernels, and the width of the convolutional kernel is fixed at dim; Perform convolution operations on M` with a stride of 1 to extract local features and obtain multiple feature maps f1, f2, f3, …, fm. The dimension of any one of the feature maps is L - an + 1, an ∈ [a1, a2, a3, …, am], which is the length of the convolutional kernel; S52: The second layer of the input is a padding and concatenation layer. Pad the feature maps with different dimensions to be the same and then concatenate them to obtain new global features from the local features, and then input to the third layer; This layer pads the channels of multiple feature maps f1, f2, f3, …, fm in the second dimension to L - a1 + 1 to obtain f1`, f2`, f3`, …, fm`, and perform a concatenation operation on f1`, f2`, f3`, …, fm` in the second dimension to form a new feature map f`, constituting a more representative global feature; S53: The third layer of the input is a residual layer. Pass the concatenated feature map through multiple residual blocks to further extract local features, and then input to the fourth layer; This layer defines multiple residual blocks, and passes f` through multiple residual blocks to further extract local features; Each residual block consists of two layers of two-dimensional convolution and batch normalization, and a ReLu activation function is performed after each layer of convolution. ReLu activation is used between multiple residual blocks; S54: The fourth input layer is a pooling layer, which is used to compress the dimension of the feature map and extract important features, and then input into the fifth layer; S55: The fifth input layer is a fully connected layer, which connects the output of the pooling layer to one or more fully connected layers for learning the relationship between features and performing final classification. Finally, it enters the output layer and outputs the text category corresponding to the category index with the largest probability value.

7. The classification method according to claim 6 using a text content classification system based on a BERT model, characterized in that: The calculation process of batch normalization is as follows: Standardization: First, standardize the data of each batch. For the input data, its mean and variance is calculated on the current batch: (1) in: is the i-th element in the input data; is the size of the current batch; is the mean of the current batch; is the variance of the current batch; Then, standardize: (2) in: is a small constant used to avoid division by zero errors; is the standardized data; Scaling and translation: Batch Normalization introduces two learnable parameters and , used to scale and translate the normalized data: (3) in: and are the parameters learned through back-propagation; It is the output after Batch Normalization; The formula of the Relu activation function is: (4); in: is the output of the hidden layer, which is the input of the Relu function.

8. The classification method according to claim 1 using a text content classification system based on a BERT model, characterized in that: The text content classification system based on the BERT model includes: Data preprocessing layer; BERT pre-trained model layer; Text semantic feature dimension-enhancing layer; Normalization layer of sentence feature matrix; MatrixResCNN model layers: Contains convolutional layers, residual layers, pooling layers, fully connected layers, and output layers.