Text classification method and device based on deep learning
By using shallow neural networks for preliminary classification in news text classification, and calling graph neural networks and bidirectional long short-term memory networks when necessary, the problems of waste of computing resources and low efficiency in the existing technology are solved, and efficient and accurate results are achieved. Text classification.
Patent Information
- Application Number
- CN202410793680.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-10-01
AI Technical Summary
The existing technology has the problems of large waste of computing resources and low computing efficiency in news text classification. In particular, complex models waste resources when processing simple texts, and simple models cannot obtain accurate results in complex text classification.
Adopt a text classification method based on deep learning, and use a pre-trained shallow neural network model to initially classify news texts. If the preliminary classification fails, the graph neural network and the bidirectional long short-term memory network model are called for secondary classification, and the hierarchical processing mechanism is used. Save computing resources and improve efficiency.
It achieves fast processing of most texts with high computational efficiency and ensures classification accuracy. By giving priority to using shallow neural networks for preliminary classification and calling complex models when necessary, it effectively saves computing resources and improves processing efficiency.
Smart Images

Figure CN118734129A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of text classification, and in particular to a text classification method and device based on deep learning. Background Art
[0002] At present, news reading software generally obtains a large amount of news information by crawling articles from various news platforms or self-media. Then, it organizes and pushes news information according to the fields to which the news titles belong, such as entertainment, life, education, technology, cute pets, cars, etc., and pushes them into different categories.
[0003] The current process of classifying and publishing news usually involves an intelligent model analyzing the title of a news text to obtain the classification of the news text. Patent CN114969324A discloses a Chinese news title classification method based on the expansion of subject word features; the subject is obtained through a compound word segmentation method and a subject word expansion method, and finally a convolutional neural network is used to obtain the classification result.
[0004] However, this type of method will make classification errors when encountering headlines that are intended to attract readers. If the entire news text is analyzed, using a simple lightweight model will not yield accurate classification results in some complex text classification tasks; and complex models will waste a lot of computing resources and reduce computing efficiency when processing simple text. Summary of the invention
[0005] The purpose of the present invention is to solve the problems of large waste of computing resources and low computing efficiency mentioned in the above background technology, and to propose a text classification method and device based on deep learning.
[0006] A first aspect of the present invention provides a text classification method based on deep learning, the method comprising:
[0007] Get a news dataset containing multiple texts;
[0008] Calling a pre-trained first deep learning model to analyze a target text to obtain a first classification result; the target text is any one of a plurality of texts; the first deep learning model is a shallow neural network model; the first classification result includes obtaining a target classification item or not obtaining a target classification item;
[0009] If the first classification result is that the target classification item is not obtained, calling a pre-trained second deep learning model to analyze the target text to obtain the target classification item; the second deep learning model is a model that combines a graph neural network and a bidirectional long short-term memory network;
[0010] According to the target classification item, the target text is stored in a corresponding classification data set.
[0011] Optionally, calling a pre-trained first deep learning model to analyze the target text to obtain a first classification result includes:
[0012] Using the title of the target text as input of the first deep learning model to obtain a first classification item;
[0013] According to a preset length, the main content of the target text is truncated to obtain multiple content fragments;
[0014] Using a target content segment as an input of the first deep learning model to obtain a second classification item; the target content segment is any one of the multiple content segments;
[0015] Selecting multiple second classification items to obtain a third classification item, and calculating a first confidence level of the third classification item;
[0016] If the first classification item is consistent with the third classification item, and the first confidence level is greater than a first preset threshold, taking the first classification item as a target classification item;
[0017] Otherwise, the first classification result is that the target classification item is not obtained.
[0018] Optionally, selecting multiple second classification items to obtain a third classification item, and calculating the first confidence of the third classification item includes:
[0019] The majority of the second classification items is used as the third classification item;
[0020] The ratio of the number of the mode items to the total number is calculated as the first confidence level.
[0021] Optionally, the first deep learning model includes a first preprocessing layer, a first word embedding layer, a hidden layer and a first output layer;
[0022] The title of the target text is used as the input of the first deep learning model, and the first classification items include:
[0023] Taking the title as the input of the first preprocessing layer to obtain a first segmented text;
[0024] Using the first word segmentation text as the input of the first word embedding layer to obtain a first word embedding vector;
[0025] Using the first vocabulary embedding vector as input of the hidden layer to obtain a first feature matrix;
[0026] The first feature matrix is used as an input of the first output layer to obtain a first classification item.
[0027] Optionally, the second deep learning model includes a second preprocessing layer, a second word embedding layer, a text embedding layer, a graph structure construction layer, a graph neural network layer, a bidirectional long short-term memory network layer, a feature fusion layer and a second output layer;
[0028] The calling of the pre-trained second deep learning model to analyze the target text to obtain the target classification items includes:
[0029] Using the main content as the input of the second preprocessing layer to obtain a second segmented text;
[0030] Using the first word segmentation text as the input of the second word embedding layer to obtain a word embedding vector;
[0031] Taking the main content as the input of the text embedding layer to obtain a text embedding vector;
[0032] Using the first segmented text as a graph structure construction layer to obtain a first graph structure; the first graph structure includes node and edge information;
[0033] Using the first graph structure and the vocabulary embedding vector as input to a graph neural network layer to obtain a word feature representation;
[0034] Using the word feature representation as an input to a bidirectional long short-term memory network layer to obtain a text feature vector;
[0035] Using the text embedding vector and the text feature vector as inputs of a feature fusion layer to obtain integrated information;
[0036] The integrated information is used as the input of the second output layer to obtain a target classification item.
[0037] A second aspect of the present invention provides a text classification device based on deep learning, the device comprising:
[0038] A data acquisition module, used to acquire a news data set containing multiple texts;
[0039] A preliminary classification module is used to call a pre-trained first deep learning model to analyze a target text to obtain a first classification result; the target text is any one of a plurality of texts; the first deep learning model is a shallow neural network model; the first classification result includes obtaining a target classification item or not obtaining a target classification item;
[0040] A secondary classification module, for calling a pre-trained second deep learning model to analyze the target text to obtain the target classification item if the first classification result is that the target classification item is not obtained; the second deep learning model is a model combining a graph neural network and a bidirectional long short-term memory network;
[0041] The news push module is used to store the target text into a corresponding classification data set according to the target classification item.
[0042] Optionally, the preliminary classification module includes:
[0043] A title classification module, used to take the title of the target text as an input of the first deep learning model to obtain a first classification item;
[0044] A content segmentation module, used to cut the main content of the target text into multiple content segments according to a preset length;
[0045] a sub-content classification module, configured to use a target content segment as an input of the first deep learning model to obtain a second classification item; the target content segment is any one of the multiple content segments;
[0046] A content classification module, configured to select a plurality of second classification items to obtain a third classification item, and calculate a first confidence level of the third classification item;
[0047] A consistency judgment module is used to take the first classification item as the target classification item if the first classification item is consistent with the third classification item and the first confidence level is greater than a first preset threshold; otherwise, the first classification result is that the target classification item is not obtained.
[0048] Optionally, the content classification module includes:
[0049] A classification item determination module, used for taking the majority item of the plurality of second classification items as the third classification item;
[0050] The confidence calculation module is used to calculate the ratio of the number of the mode items to the total number as the first confidence.
[0051] Optionally, the first deep learning model includes a first preprocessing layer, a first word embedding layer, a hidden layer and a first output layer;
[0052] The title classification module includes:
[0053] A first word segmentation module, used for taking the title as an input of the first preprocessing layer to obtain a first word segmentation text;
[0054] A first word embedding module, configured to use the first word segmentation text as an input of the first word embedding layer to obtain a first vocabulary embedding vector;
[0055] a feature transfer module, configured to use the first vocabulary embedding vector as an input of the hidden layer to obtain a first feature matrix;
[0056] The first classifier module is used to use the first feature matrix as an input of the first output layer to obtain a first classification item.
[0057] Optionally, the second deep learning model includes a second preprocessing layer, a second word embedding layer, a text embedding layer, a graph structure construction layer, a graph neural network layer, a bidirectional long short-term memory network layer, a feature fusion layer and a second output layer;
[0058] The secondary classification module comprises:
[0059] A second word segmentation module, used for taking the main content as the input of the second preprocessing layer to obtain a second word segmentation text;
[0060] A second word embedding module, configured to use the first word segmentation text as an input of the second word embedding layer to obtain a word embedding vector;
[0061] A text first feature module, used to take the main content as input of the text embedding layer to obtain a text embedding vector;
[0062] A graph construction module, configured to use the first segmented text as a graph structure construction layer to obtain a first graph structure; the first graph structure includes node and edge information;
[0063] A word feature updating module, used for taking the first graph structure and the vocabulary embedding vector as input of a graph neural network layer to obtain a word feature representation;
[0064] A second text feature module, used for taking the word feature representation as an input of a bidirectional long short-term memory network layer to obtain a text feature vector;
[0065] A feature fusion module, used for taking the text embedding vector and the text feature vector as input of a feature fusion layer to obtain integrated information;
[0066] The second classifier module is used to use the integrated information as the input of the second output layer to obtain a target classification item.
[0067] Beneficial effects of the present invention:
[0068] The present invention proposes a text classification method based on deep learning, which includes: obtaining a news data set containing multiple texts; calling a pre-trained first deep learning model to analyze a target text to obtain a first classification result; the target text is any one of the multiple texts; the first deep learning model is a shallow neural network model; the first classification result includes obtaining a target classification item or not obtaining the target classification item; if the first classification result is that the target classification item is not obtained, calling a pre-trained second deep learning model to analyze the target text to obtain the target classification item; the second deep learning model is a model combining a graph neural network and a bidirectional long short-term memory network; according to the target classification item, storing the target text in a corresponding classification data set.
[0069] By using a shallow neural network model with high computational efficiency and low cost, most texts can be processed quickly; for texts that cannot be accurately classified by shallow models, complex graph neural networks and bidirectional long short-term memory networks are used to ensure classification accuracy. Through a hierarchical processing mechanism, shallow neural networks are used first for preliminary classification, and complex models are called only when necessary, effectively saving computing resources and improving processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] The present invention will be further described below in conjunction with the accompanying drawings.
[0071] Figure 1 A flowchart of a text classification method based on deep learning is provided for an embodiment of the present invention;
[0072] Figure 2 A structural diagram of a text classification device based on deep learning is provided for an embodiment of the present invention. DETAILED DESCRIPTION
[0073] 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.
[0074] The embodiment of the present invention provides a text classification method based on deep learning. Figure 1 , Figure 1 A flowchart of a text classification method based on deep learning provided by an embodiment of the present invention. The method comprises the following steps:
[0075] S101, obtaining a news dataset containing multiple texts.
[0076] S102, calling a pre-trained first deep learning model to analyze the target text to obtain a first classification result.
[0077] S103: If the first classification result is that the target classification item is not obtained, call the pre-trained second deep learning model to analyze the target text to obtain the target classification item.
[0078] S104: According to the target classification item, the target text is stored in a corresponding classification data set.
[0079] The target text is any one of a plurality of texts; the first deep learning model is a shallow neural network model; the first classification result includes obtaining a target classification item or not obtaining a target classification item; the second deep learning model is a model combining a graph neural network and a bidirectional long short-term memory network;
[0080] A text classification method based on deep learning provided by an embodiment of the present invention can quickly process most texts by using a shallow neural network model with high computational efficiency and low cost; for texts that cannot be accurately classified by the shallow model, a complex graph neural network and a bidirectional long short-term memory network are used to ensure the accuracy of classification. Through a hierarchical processing mechanism, shallow neural networks are used first for preliminary classification, and complex models are called only when necessary, which effectively saves computing resources and improves processing efficiency.
[0081] In one embodiment, step S102 includes:
[0082] Step 1: Use the title of the target text as the input of the first deep learning model to obtain the first classification item.
[0083] Step 2: According to a preset length, the main content of the target text is truncated to obtain multiple content fragments.
[0084] Step three: Use the target content segment as input of the first deep learning model to obtain a second classification item.
[0085] Step 4: Select multiple second classification items to obtain third classification items, and calculate the first confidence of the third classification items.
[0086] Step five: if the first classification item is consistent with the third classification item and the first confidence level is greater than the first preset threshold, the first classification item is used as the target classification item; otherwise, the first classification result is that the target classification item is not obtained.
[0087] The target content segment is any one of the multiple content segments.
[0088] In one implementation, the main content of the text is first divided into paragraphs. If the length of a paragraph is greater than a preset length, the paragraph is truncated according to the preset length, thereby retaining the overall information of the paragraph as much as possible, which helps to improve the accuracy of classification.
[0089] In one implementation, the text title is usually a concise summary of the article, which can quickly provide classification clues and help the model quickly make preliminary classification decisions; the computational complexity of processing the title is small, which can save computing resources.
[0090] In one implementation, by setting a preset threshold, only classification results with a high enough confidence level will be accepted, thereby ensuring the accuracy and credibility of the final classification result. For example, the preset threshold can be set to 0.5.
[0091] In one implementation, the reliability of the classification decision can be increased by verifying the consistency of the title classification result and the content classification result.
[0092] In one embodiment, selecting multiple second classification items to obtain a third classification item, and calculating the first confidence of the third classification item includes:
[0093] Step 1: Use the majority item of multiple second classification items as the third classification item.
[0094] Step 2: Calculate the ratio of the number of mode items to the total number as the first confidence level.
[0095] In one implementation, calculating the mode is a simple and efficient method that can quickly produce a comprehensive classification result.
[0096] In one implementation, the reliability of the classification result is quantified by calculating the ratio of the majority item to the total number. The higher the first confidence, the more consistent and reliable the classification result. For example, the main content of a text is divided into 5 sections, which are classified as automobile, automobile, automobile, economy, and economy respectively; then the majority item is automobile, and the first confidence is 3 / 5.
[0097] In one embodiment, the first deep learning model includes a first preprocessing layer, a first word embedding layer, a hidden layer, and a first output layer;
[0098] The title of the target text is used as the input of the first deep learning model, and the first classification items include:
[0099] The title is used as the input of the first preprocessing layer to obtain the first segmented text.
[0100] The first word segmentation text is used as the input of the first word embedding layer to obtain the first word embedding vector.
[0101] The first vocabulary embedding vector is used as the input of the hidden layer to obtain the first feature matrix.
[0102] The first feature matrix is used as the input of the first output layer to obtain the first classification item.
[0103] In one implementation, the first deep learning model has a simple and efficient structure, which is suitable for processing short text classification tasks. The shallow neural network structure has a small amount of calculation, fast training and prediction speed, and can quickly process large-scale news texts.
[0104] In one embodiment, the second deep learning model includes a second preprocessing layer, a second word embedding layer, a text embedding layer, a graph structure construction layer, a graph neural network layer, a bidirectional long short-term memory network layer, a feature fusion layer, and a second output layer;
[0105] Step S103 includes:
[0106] The main content is used as the input of the second preprocessing layer to obtain the second word segmentation text.
[0107] The first word segmentation text is used as the input of the second word embedding layer to obtain the vocabulary embedding vector.
[0108] The main content is used as the input of the text embedding layer to obtain the text embedding vector.
[0109] The first segmented text is used as a graph structure construction layer to obtain a first graph structure.
[0110] The first graph structure and vocabulary embedding vector are used as input to the graph neural network layer to obtain word feature representation.
[0111] The word feature representation is used as the input of the bidirectional long short-term memory network layer to obtain the text feature vector.
[0112] The text embedding vector and text feature vector are used as the input of the feature fusion layer to obtain the integrated information.
[0113] The integrated information is used as the input of the second output layer to obtain the target classification item.
[0114] The first graph structure includes information about nodes and edges.
[0115] In one implementation, the text is constructed as a graph structure, where nodes represent words and edges represent the relationships between words, which can capture the structured information in the text. The graph structure can represent complex relationships and dependencies, has strong adaptability, and can better handle contextual relationships in the text. Through the graph neural network (GNN) layer, high-order feature representations can be extracted from the graph structure to capture the deep relationships between words. GNN can handle long-distance dependencies, making up for the shortcomings of traditional convolutional neural network (RNN) models in processing long texts.
[0116] In one implementation, the bidirectional long short-term memory network (BiLSTM) can simultaneously consider forward and backward contextual information to improve the ability to understand text. Combining GNN and BiLSTM layers can capture the deep features and complex dependencies of text and improve classification accuracy.
[0117] In one implementation, the robustness and generalization ability of the model are enhanced through multi-layer feature extraction and fusion.
[0118] The embodiment of the present invention provides a text classification device based on deep learning. Figure 2 , Figure 2 This is a structural diagram of a text classification device based on deep learning provided by an embodiment of the present invention. The device includes the following modules:
[0119] The data acquisition module is used to obtain a news dataset containing multiple texts.
[0120] The preliminary classification module is used to call the pre-trained first deep learning model to analyze the target text and obtain a first classification result.
[0121] The secondary classification module is used to call the pre-trained second deep learning model to analyze the target text and obtain the target classification item if the first classification result is that the target classification item is not obtained.
[0122] The news push module is used to store the target text into the corresponding classification data set according to the target classification item.
[0123] Among them, the target text is any one of multiple texts; the first deep learning model is a shallow neural network model; the first classification result includes obtaining the target classification item or not obtaining the target classification item; the second deep learning model is a model that combines a graph neural network and a bidirectional long short-term memory network.
[0124] A text classification device based on deep learning provided by an embodiment of the present invention can quickly process most texts by using a shallow neural network model with high computational efficiency and low cost; for texts that cannot be accurately classified by the shallow model, a complex graph neural network and a bidirectional long short-term memory network are used to ensure the accuracy of classification. Through a hierarchical processing mechanism, shallow neural networks are preferentially used for preliminary classification, and complex models are called only when necessary, which effectively saves computing resources and improves processing efficiency.
[0125] In one embodiment, the preliminary classification module includes:
[0126] A title classification module, used for taking the title of the target text as an input of the first deep learning model to obtain a first classification item;
[0127] A content segmentation module is used to cut the main content of the target text into multiple content segments according to a preset length;
[0128] A sub-content classification module, used to use a target content segment as an input of the first deep learning model to obtain a second classification item; the target content segment is any one of the multiple content segments;
[0129] A content classification module, used for selecting a plurality of second classification items to obtain a third classification item, and calculating a first confidence level of the third classification item;
[0130] The consistency judgment module is used to take the first classification item as the target classification item if the first classification item is consistent with the third classification item and the first confidence level is greater than a first preset threshold; otherwise, the first classification result is that the target classification item is not obtained.
[0131] In one embodiment, the content classification module includes:
[0132] A classification item determination module, used for taking the majority item of the plurality of second classification items as the third classification item;
[0133] The confidence calculation module is used to calculate the ratio of the number of mode items to the total number as the first confidence.
[0134] In one embodiment, the first deep learning model includes a first preprocessing layer, a first word embedding layer, a hidden layer, and a first output layer;
[0135] The title classification module includes:
[0136] A first word segmentation module, used for taking the title as an input of a first preprocessing layer to obtain a first word segmentation text;
[0137] A first word embedding module, used to take the first word segmentation text as the input of the first word embedding layer to obtain a first word embedding vector;
[0138] A feature transfer module, configured to use the first vocabulary embedding vector as an input of the hidden layer to obtain a first feature matrix;
[0139] The first classifier module is used to use the first feature matrix as an input of the first output layer to obtain a first classification item.
[0140] In one embodiment, the second deep learning model includes a second preprocessing layer, a second word embedding layer, a text embedding layer, a graph structure construction layer, a graph neural network layer, a bidirectional long short-term memory network layer, a feature fusion layer, and a second output layer;
[0141] The secondary classification module includes:
[0142] A second word segmentation module, used for taking the main content as the input of the second preprocessing layer to obtain a second word segmentation text;
[0143] A second word embedding module, used for taking the first word segmentation text as the input of the second word embedding layer to obtain a word embedding vector;
[0144] The text first feature module is used to take the main content as the input of the text embedding layer to obtain the text embedding vector;
[0145] A graph construction module, used to use the first segmented text as a graph structure construction layer to obtain a first graph structure; the first graph structure includes node and edge information;
[0146] A word feature updating module, used for taking the first graph structure and the vocabulary embedding vector as input of the graph neural network layer to obtain a word feature representation;
[0147] The second text feature module is used to use the word feature representation as the input of the bidirectional long short-term memory network layer to obtain the text feature vector;
[0148] The feature fusion module is used to use the text embedding vector and the text feature vector as the input of the feature fusion layer to obtain integrated information;
[0149] The second classifier module is used to use the integrated information as the input of the second output layer to obtain the target classification item.
[0150] The above is a detailed description of an embodiment of the present invention, but the content is only a preferred embodiment of the present invention and cannot be considered to limit the scope of implementation of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent coverage of the present invention.
Claims
1. A text classification method based on deep learning, characterized in that: The method comprises: Get a news dataset containing multiple texts; Calling a pre-trained first deep learning model to analyze a target text to obtain a first classification result; the target text is any one of a plurality of texts; the first deep learning model is a shallow neural network model; the first classification result includes obtaining a target classification item or not obtaining a target classification item; If the first classification result is that the target classification item is not obtained, calling a pre-trained second deep learning model to analyze the target text to obtain the target classification item; the second deep learning model is a model that combines a graph neural network and a bidirectional long short-term memory network; According to the target classification item, the target text is stored in a corresponding classification data set.
2. A text classification method based on deep learning according to claim 1, characterized in that: The calling of the pre-trained first deep learning model to analyze the target text to obtain the first classification result includes: Using the title of the target text as input of the first deep learning model to obtain a first classification item; According to a preset length, the main content of the target text is truncated to obtain multiple content fragments; Using a target content segment as an input of the first deep learning model to obtain a second classification item; the target content segment is any one of the multiple content segments; Selecting multiple second classification items to obtain a third classification item, and calculating a first confidence level of the third classification item; If the first classification item is consistent with the third classification item and the first confidence level is greater than a first preset threshold, the first classification item is used as the target classification item; otherwise, the first classification result is that the target classification item is not obtained.
3. A text classification method based on deep learning according to claim 2, characterized in that: The step of selecting a plurality of second classification items to obtain a third classification item and calculating a first confidence level of the third classification item includes: The majority of the second classification items is used as the third classification item; The ratio of the number of the mode items to the total number is calculated as the first confidence level.
4. The text classification method based on deep learning according to claim 2, characterized in that: The first deep learning model includes a first preprocessing layer, a first word embedding layer, a hidden layer and a first output layer; The title of the target text is used as the input of the first deep learning model, and the first classification items include: Taking the title as the input of the first preprocessing layer to obtain a first segmented text; Using the first word segmentation text as the input of the first word embedding layer to obtain a first word embedding vector; Using the first vocabulary embedding vector as input of the hidden layer to obtain a first feature matrix; The first feature matrix is used as an input of the first output layer to obtain a first classification item.
5. The text classification method based on deep learning according to claim 1, characterized in that: The second deep learning model includes a second preprocessing layer, a second word embedding layer, a text embedding layer, a graph structure construction layer, a graph neural network layer, a bidirectional long short-term memory network layer, a feature fusion layer, and a second output layer; The calling of the pre-trained second deep learning model to analyze the target text to obtain the target classification items includes: Using the main content as the input of the second preprocessing layer to obtain a second segmented text; Using the first word segmentation text as the input of the second word embedding layer to obtain a word embedding vector; Taking the main content as the input of the text embedding layer to obtain a text embedding vector; Using the first segmented text as a graph structure construction layer to obtain a first graph structure; the first graph structure includes node and edge information; Using the first graph structure and the vocabulary embedding vector as input to a graph neural network layer to obtain a word feature representation; Using the word feature representation as an input to a bidirectional long short-term memory network layer to obtain a text feature vector; Using the text embedding vector and the text feature vector as inputs of a feature fusion layer to obtain integrated information; The integrated information is used as the input of the second output layer to obtain a target classification item.
6. A text classification device based on deep learning, characterized in that: The device comprises: A data acquisition module, used to acquire a news data set containing multiple texts; A preliminary classification module is used to call a pre-trained first deep learning model to analyze a target text to obtain a first classification result; the target text is any one of a plurality of texts; the first deep learning model is a shallow neural network model; the first classification result includes obtaining a target classification item or not obtaining a target classification item; A secondary classification module, for calling a pre-trained second deep learning model to analyze the target text to obtain the target classification item if the first classification result is that the target classification item is not obtained; the second deep learning model is a model combining a graph neural network and a bidirectional long short-term memory network; The news push module is used to store the target text into a corresponding classification data set according to the target classification item.
7. The text classification device based on deep learning according to claim 6, characterized in that: The preliminary classification module includes: A title classification module, used to take the title of the target text as an input of the first deep learning model to obtain a first classification item; A content segmentation module, used to cut the main content of the target text into multiple content segments according to a preset length; a sub-content classification module, configured to use a target content segment as an input of the first deep learning model to obtain a second classification item; the target content segment is any one of the multiple content segments; A content classification module, configured to select a plurality of second classification items to obtain a third classification item, and calculate a first confidence level of the third classification item; A consistency judgment module is used to take the first classification item as the target classification item if the first classification item is consistent with the third classification item and the first confidence level is greater than a first preset threshold; otherwise, the first classification result is that the target classification item is not obtained.
8. The text classification device based on deep learning according to claim 7, characterized in that: The content classification module includes: A classification item determination module, used for taking the majority item of the plurality of second classification items as the third classification item; The confidence calculation module is used to calculate the ratio of the number of the mode items to the total number as the first confidence.
9. The text classification device based on deep learning according to claim 7, characterized in that: The first deep learning model includes a first preprocessing layer, a first word embedding layer, a hidden layer and a first output layer; The title classification module includes: A first word segmentation module, used for taking the title as an input of the first preprocessing layer to obtain a first word segmentation text; A first word embedding module, configured to use the first word segmentation text as an input of the first word embedding layer to obtain a first vocabulary embedding vector; a feature transfer module, configured to use the first vocabulary embedding vector as an input of the hidden layer to obtain a first feature matrix; The first classifier module is used to use the first feature matrix as an input of the first output layer to obtain a first classification item.
10. The text classification device based on deep learning according to claim 6, characterized in that: The second deep learning model includes a second preprocessing layer, a second word embedding layer, a text embedding layer, a graph structure construction layer, a graph neural network layer, a bidirectional long short-term memory network layer, a feature fusion layer, and a second output layer; The secondary classification module comprises: A second word segmentation module, used for taking the main content as the input of the second preprocessing layer to obtain a second word segmentation text; A second word embedding module, configured to use the first word segmentation text as an input of the second word embedding layer to obtain a word embedding vector; A text first feature module, used to take the main content as input of the text embedding layer to obtain a text embedding vector; A graph construction module, configured to use the first segmented text as a graph structure construction layer to obtain a first graph structure; the first graph structure includes node and edge information; A word feature updating module, used for taking the first graph structure and the vocabulary embedding vector as input of a graph neural network layer to obtain a word feature representation; A second text feature module, used for taking the word feature representation as an input of a bidirectional long short-term memory network layer to obtain a text feature vector; A feature fusion module, used for taking the text embedding vector and the text feature vector as input of a feature fusion layer to obtain integrated information; The second classifier module is used to use the integrated information as the input of the second output layer to obtain a target classification item.
Citation Information
Patent Citations
Chinese news title classification method based on subject term feature extension
CN114969324A
Combined neural network-based text classification method, device and computer equipment
CN110489550A
Content identification and classification method, device and system and storage medium
CN113239200A
Cultural resource text classification method based on memory network and graph neural network
CN113516198A
Text classification method and device, equipment and storage medium
CN115640399A
