A community topic classification method based on composite network and graph attention mechanism

By establishing a keyword-topic composite network and a dual-layer graph attention mechanism, the problem of ignoring semantic relationships and key information in the existing technology is solved, and high-accuracy classification effects on community topic data sets are achieved.

CN114818719BActive Publication Date: 2024-10-29PENGFENG (CHANGSHA) TECHNOLOGY CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210615230.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-01
Publication Date
2024-10-29
Estimated Expiration
2042-06-01

AI Technical Summary

Technical Problem

The existing technology ignores the semantic relationship between words and texts in community topic classification, and fails to effectively utilize local key information and global information, resulting in low classification accuracy.

Method used

A community topic classification method based on composite network and graph attention mechanism is proposed. By establishing a keyword-topic composite network, two graph structures of topic nodes are extracted, and a double-layer graph attention mechanism is used to update node features, combined with BiLSTM pre-processing. Training model initialization features.

Benefits of technology

It achieves high classification accuracy on community topic data sets, avoids the problem of inaccurate keyword extraction by a single algorithm, takes into account semantics and word frequency, and improves the accuracy of hot topic discovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114818719B_ABST
    Figure CN114818719B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of computer natural language processing, and relates to a community topic classification method based on a composite network and a graph attention mechanism. The specific steps include: data preprocessing, keyword extraction, feature initialization, establishment of two graph structures, establishment of a graph attention neural network classification model and output node classification; according to the characteristics of the community topic data set, starting from the key information and the content of the topic itself, a keyword-topic composite complex network is established, and then two graph structures of topic nodes are extracted, and the features are updated using a double-layer attention mechanism and used for node classification tasks; compared with other existing models, the method proposed in the present invention achieves better classification effect and high classification accuracy; and provides a guarantee for hot topic discovery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical field:

[0001] The present invention belongs to the technical field of computer natural language processing, and relates to a community topic classification method based on a composite network and a graph attention mechanism. For some community topic data sets in Qingdao, a composite complex network that integrates key information and characteristic information of the topic itself is proposed, from which two graph structures about topics are mapped, and a good classification effect is achieved by combining the double-layer graph attention mechanism. Background technology:

[0002] Topic is a type of short text, and short text classification is one of the core technologies of natural language processing. The Chinese short text classification process includes text preprocessing, text feature representation, and classifier construction. Feature representation is the key content of text classification.

[0003] In recent years, graph neural networks (GNNs) have attracted widespread attention in the academic community. They rely on nodes and edges to show strong message transmission and feature learning capabilities, and have been applied to natural language processing tasks. For example, YAO proposed the Text-GCN model, which takes text and the words it contains as nodes and regards text classification as a node classification task; based on YAO, LIU et al. proposed the Tensor-GCN model, which constructs a text graph tensor based on semantics and syntax, and can propagate node information within and between graphs on the tensor graph; Huang et al. proposed to build a separate graph for each document and share parameters, reducing storage space consumption; Zhang et al. proposed TextING, which uses sliding windows to build graphs and uses Gated GNN to update node information; Hu et al. proposed HGAT, which adds topics and entities to enrich sentence semantics and builds a heterogeneous graph for the entire text classification task. When building graph models, the above methods do not consider the semantic relationship between words and texts, and between texts, and ignore the importance of key information to the text. They treat all words equally to build graphs, increasing the impact of irrelevant data.

[0004] Topic data has the following characteristics: few words, sparse features, and no redundant comment information, and it is impossible to rely on external information to expand the data; the category labels of some data appear in the topic, and local key information is particularly important for this part of the topic; the topics are posted by residents, resulting in some topics with more colloquial information and no key information, so the global information of this part of the topic is particularly important.

[0005] Based on this, the present invention proposes to establish a composite complex network, including two types of nodes: keywords and topics, and then extract two topic node graph structures in the network; and use the powerful feature learning ability of the graph attention network to complete the text classification task of community topic data. Summary of the invention:

[0006] The purpose of this invention is to address some problems existing in community topic classification and propose a community topic classification method (DGAT) based on graph attention mechanism. The establishment of a graph model in this method can reasonably classify community topic data. Compared with the baseline model, it can achieve better classification effect on the community topic dataset.

[0007] In order to achieve the above object, the present invention provides a community topic classification method based on a composite network and a graph attention mechanism, and the specific steps include:

[0008] S1. Data preprocessing:

[0009] Use the rule filtering library to filter irrelevant information on the acquired topic data set;

[0010] S2. Extract keywords: Use an integrated algorithm to extract keywords from the preprocessed topic data, use Baidu's natural language processing tool to perform word segmentation supervision, and remove stop words and named entities;

[0011] S3, initialization features: Initialize the preprocessed data and use word2vec and BiLSTM pre-training models to obtain the initial feature matrix X of the topic set T = {x1, x2, ..., x n};

[0012] S4. Establish two graph structures: Use the preprocessed topic data set to establish a keyword-topic composite network for the entire data set, and extract two graph structures from the network: a keyword-topic relationship mapping graph structure and a topic similarity graph structure;

[0013] S5. Establish a graph attention neural network classification model: and use the stochastic gradient descent method to train the model until the loss function converges, retaining the optimal parameters of the model;

[0014] S6. Output node classification: After the topic data to be classified enters the trained graph attention neural network classification model, the node features are obtained, and the node features are passed through the softmax classifier to obtain the label to which the model predicts the data.

[0015] The specific steps of step S3 are as follows: First, use word2vec to initialize the topic t in the input layer. i The word vector of topic t i The randomly initialized feature matrix X i '; Then randomly initialize the feature matrix X i ′ Input the BiLSTM pre-trained model, use the forward and backward LSTM to learn features and obtain features in two directions respectively; finally, concatenate the features in the two directions to obtain t i The eigenvector xi Based on this, we get the initial feature matrix X = {x1, x2, ..., x n};

[0016] The keyword-topic composite network in step S4 includes a sub-network of the relationship between keywords and topics and a sub-network of the similarity relationship between topics. The specific steps of establishing the two graph structures are as follows:

[0017] S41. Establish a mapping graph structure of the relationship between keywords and topics: Map an undirected graph between topics and topic nodes based on the relationship subnetwork between keywords and topics. The undirected graph structure is represented by G = (A, X), where A ∈ R n×n is the symmetric adjacency matrix of the undirected graph, a ij is an element in A, a ij = 1 means that there is an edge between topic node i and topic node j, n represents the number of topic nodes, X∈R n×d is the initial feature matrix of the topic set T, and d is the dimension of the feature;

[0018] S42. Establish topic similarity graph structure: calculate the feature similarity S between all topic nodes through cosine similarity, and then use the K nearest neighbor idea to obtain the k nodes with the greatest similarity to the current node for edge connection; finally establish an undirected graph structure G based on K nearest neighbors k =(A k , X), A k It is the symmetric adjacency matrix of an undirected graph based on K nearest neighbors;

[0019] The structure of the graph attention neural network classification model includes an input layer, a feature update layer, a feature fusion layer and an output layer, wherein the feature update layer and the feature fusion layer are connected in series; the feature update layer is two parallel graph attention neural networks, each graph attention neural network includes an input layer, two graph attention layers and a splicing layer; the feature fusion layer is a semantic attention layer, which is used to fuse the output features of the two parallel graph attention neural networks;

[0020] The working principle of the graph attention neural network classification model is:

[0021] S51, Feature Update:

[0022] The two graph structure features established in step S3 are entered into the graph attention neural network for updating. The specific steps are as follows:

[0023] S511, input the two graph structure features established in step S3 into two parallel graph attention neural networks respectively, the two parallel graph attention neural networks have the same structure and the same calculation method;

[0024] S512, after two layers of graph attention layers and one layer of concatenation, the two graph structure features obtain feature matrices Z based on different graph structures respectively. r and Z k ,in is the updated feature matrix under the graph structure G = (A, X), For the graph structure G k =(A k , X) under the updated feature matrix;

[0025] Among them, each graph attention layer uses the attention mechanism to calculate the neighbor node pairs <t i ,t j >The weight between ij , and then use the softmax function to normalize to get the attention score α ij , the formula is as follows:

[0026] e ij =σ(β T [γx i ||γx j ])

[0027]

[0028] Among them, e ij Representative node t j t i The importance of ij With e ji Asymmetric between; γ∈R d×d is a shared weight matrix; β∈R 2d is the attention parameter vector; σ is the activation function, and the LeakyReLU function is used here for activation; || represents the concatenation operation between two feature vectors; N i Represents node t i The set of all neighbor nodes in the current graph structure; therefore, the node has two graph structures G and G k下 The attention scores calculated by the graph attention layer are and

[0029] Each graph attention layer uses a multi-head attention mechanism and repeats the calculation M times;

[0030] The concatenation layer is to transform the topic node t i The attention scores of all neighbor nodes are summed with feature weights to get t i Features after nonlinear transformation or The formula is as follows:

[0031]

[0032]

[0033] in, The nodes are in the graph structures G and G respectively. k The attention score of the m-th attention head; γ r(m) , γ k(m) The nodes are in the graph structures G and G respectively. k The shared parameter matrix under the m-th attention head;

[0034] S52, Feature Fusion:

[0035] The feature matrix Z learned under the two graph structures r and Z k The importance of different structural semantic features is learned through the semantic attention layer:

[0036] (θ r ,θ k )=Att NN (Z r , Z k )

[0037] Among them, Att NN (Z r , Z k ) represents the attention network that learns the importance of different semantic features, θ r ,θ k are the attention coefficients of different semantic features,

[0038] For node t i , Indicates that in the matrix Z r Specifically, nonlinear transformation and normalization are used to obtain the attention coefficients of different semantic structures on the classification results of the current node.

[0039]

[0040]

[0041] Among them, W is the weight matrix, b is the bias vector, μ T To share the attention vector, the node t is transformed into i In Z r Features below Mapped to a real weight Same reason For node t i Feature matrix Z k The weights under , and then normalize the two into the final attention coefficient through the softmax function and Finally, the two features are weighted and summed by the semantic attention coefficient to obtain the final feature matrix Z':

[0042] Z′=θ r *Z r +θ k *Z k

[0043] S53, output node classification

[0044] Send the fused feature matrix Z' to the softmax classifier to obtain the label probability value p of the data predicted by the model ij ;

[0045] Use the cross entropy function to minimize the loss of the model. The formula is as follows:

[0046]

[0047] Among them, C is the number of labels of topic data, y ij is the vector distribution of the true label of the topic data, p ij is the probability value of the model's predicted label for the topic data;

[0048] Finally, the model is trained using the stochastic gradient descent method until the loss function converges and the optimal parameters of the model are retained.

[0049] The implementation concept of the present invention is as follows: starting from the characteristics of the topic, combining the composite network and graph attention to realize the classification task, extracting keywords through an integrated algorithm to strengthen the role of key information; in order to obtain global information, starting from the topic itself, calculating the similarity, and using the K-nearest neighbor idea to establish a keyword-topic composite network; extracting two topic node graph structures based on local key information and global feature information in the network, updating the node information based on the graph attention network (GAT), and on this basis adding another layer of attention to learn the influence of different graph structures on the current node classification, so as to complete the topic classification task; in addition, using the BiLSTM pre-training model to initialize the node input features.

[0050] Compared with the prior art, the present invention has the following beneficial effects: according to the characteristics of the community topic data set, it is proposed to establish a keyword-topic composite complex network based on key information and the content of the topic itself; the integrated algorithm is used to extract keywords, which can avoid the problem of inaccurate keyword extraction caused by using a single algorithm, while taking into account the influence of semantics and word frequency on keyword extraction; then two graph structures of topic nodes are extracted, and the double-layer attention mechanism is used to update the features and use them for node classification tasks. On the community topic data set, the method DGAT proposed in the present invention achieves better classification results and high classification accuracy than other existing models, providing a guarantee for hot topic discovery. Description of the drawings:

[0051] Figure 1 The present invention provides a schematic diagram of the overall process of a community topic classification method based on a composite network and a graph attention mechanism.

[0052] Figure 2 It is a schematic diagram of the structural principle of the keyword-topic composite network model involved in the present invention.

[0053] Figure 3 This is a schematic diagram of the framework structure principle of the graph attention neural network classification model involved in the present invention.

[0054] Figure 4 This is a schematic diagram of the working principle of the community topic classification method based on a composite network and a graph attention mechanism involved in the present invention. Specific implementation method:

[0055] The present invention is further described below by way of embodiments in conjunction with the accompanying drawings.

[0056] Embodiment 1:

[0057] This embodiment relates to a community topic classification method based on a composite network and a graph attention mechanism, and the specific steps are as follows:

[0058] Step 1: Data preprocessing:

[0059] The community topic data collected on the "Zai Shibei" APP is used as a data set. Topic data generally contains irrelevant information such as Emoji expressions, emoticons, special characters, and URLs. The rule filtering library is used to match different types of information, and the entire topic data set is preprocessed to filter irrelevant information.

[0060] Step 2: Keyword extraction:

[0061] Keywords are the core words that represent a single topic data; each sentence in the topic data set T is called a topic t i ,right Multiple keywords k can be extractedi Characterize the topic; the present invention uses an integrated algorithm to extract keywords from the preprocessed topic data, and uses Baidu's natural language processing tool (LAC) for word segmentation supervision, and identifies named entities and stop words and stores them in the stop word table, and removes stop words and named entities. The integrated operation H is defined as follows:

[0062]

[0063] Among them, the weight set U={u1,u2,...,u n}, the weight indicates the influence of each algorithm on the result, the base algorithm result set F = {f1,f2,...,f n}, n is the total number of base algorithm results, requiring The base algorithms are F-IDF algorithm, TextRank algorithm and LTP keyword extraction algorithm of Harbin Institute of Technology;

[0064] The integrated algorithm is to integrate the TF-IDF algorithm, the TextRank algorithm and the LTP keyword extraction algorithm of Harbin Institute of Technology, and the integration ratio of the three algorithms is 1:1:2;

[0065] Step 3: Initialize features:

[0066] Initialize the preprocessed data. The specific steps are as follows: First, use word2vec to initialize the topic t in the input layer i The word vector of topic t i The randomly initialized feature matrix X i '; Then randomly initialize the feature matrix X i ′ Input the BiLSTM pre-trained model (including bidirectional LSTM and feature concatenation layer), use forward and backward LSTM to learn features and obtain features in two directions respectively; finally, concatenate the features in two directions to obtain t i The eigenvector x i Based on this, we get the initial feature matrix X = {x1, x2, ..., x n};

[0067] Step 4: Create two graph structures:

[0068] The preprocessed topic dataset is used to build a keyword-topic composite network for the entire topic dataset. The keyword-topic composite network includes a sub-network of the relationship between keywords and topics and a sub-network of the similarity between topics. The two undirected graph structures are mapped based on the relationship between keywords and topics and generated based on the similarity between topics.

[0069] Step 4.1: Establish a mapping structure between keywords and topics

[0070] The keyword-topic belonging relationship mapping graph structure is a graph structure generated by keyword-topic belonging relationship mapping;

[0071] In the keyword-topic composite network, if the keyword node k i is at topic node t i Extracted from, then establish k i With t i The edge of the relationship between i = <t i ,k j > represents keyword node k j Belongs to topic node t i ; If there is an edge e i = <t i ,k i > with edge e j = <t j ,k i >, explain the topic t i With t j The nodes are all related to the keyword node k i Connected, t i With t j belong to the same category; therefore, according to the relationship between topics and keywords, an undirected graph between topics and topic nodes is mapped, and the undirected graph structure is represented as G = (A, X), where A ∈ R n×n is the symmetric adjacency matrix of the undirected graph, a ij is an element in A, a ij = 1 means there is an edge between nodes i and j, n represents the number of topic nodes, X∈R n×d is the feature matrix of the topic node, and d is the dimension of the feature;

[0072] Step 4.2: Establish the topic similarity graph structure:

[0073] The topic similarity graph structure is a graph structure generated by the similarity of the topic itself;

[0074] The feature similarity S between all topic nodes is calculated by cosine similarity. The formula is as follows. Then, the K nearest neighbor idea is used to obtain the k nodes with the greatest similarity to the current node for edge connection. Finally, an undirected graph structure G based on K nearest neighbors is established. k =(A k , X), A k It is the symmetric adjacency matrix of an undirected graph based on K nearest neighbors;

[0075]

[0076] Among them, x i 、x j They are topic nodes t i ,t j The characteristic is a one-dimensional vector; |x i |、|x j | are topic nodes t i ,t j Model;

[0077] Step 5: Establish a graph attention neural network classification model and train the model using the stochastic gradient descent method until the loss function converges, retaining the optimal parameters of the model;

[0078] The structure of the graph attention neural network classification model includes an input layer, a feature update layer, a feature fusion layer and an output layer, wherein the feature update layer and the feature fusion layer are connected in series; the feature update layer is two parallel graph attention neural networks, each graph attention neural network includes an input layer, two graph attention layers and a splicing layer; the feature fusion layer is a semantic attention layer, which is used to fuse the output features of the two parallel graph attention neural networks;

[0079] The working principle of the graph attention neural network classification model is:

[0080] Step 5.1 Feature Update:

[0081] The two graph structure features established in step S3 are entered into the graph attention neural network for updating. The specific steps are as follows:

[0082] Step 5.11, input the two graph structure features established in step S3 (each graph structure feature includes its corresponding symmetric adjacency matrix and initial feature matrix) into two parallel graph attention neural networks respectively, the two parallel graph attention neural networks have the same structure and the same calculation method;

[0083] Step 5.12 After two layers of graph attention and one layer of concatenation, the two graph structure features obtain feature matrices Z based on different graph structures. r and Z k , Z r and Z k To combine the updated features of all topic nodes together to obtain the feature matrix of the entire data set, is the updated feature matrix under the graph structure G = (A, X), For the graph structure G k =(A k , X) under the updated feature matrix;

[0084] Among them, each graph attention layer uses the attention mechanism to calculate the neighbor node pairs <t i ,t j >The weight between ij , and then use the softmax function to normalize to get the attention score α ij , the formula is as follows:

[0085] e ij =σ(β T [γx i ||γx j ])

[0086]

[0087] Among them, e ij Representative node t j t i The importance of ij With e ji Asymmetric between; γ∈R d×d is a shared weight matrix; β∈R 2d is the attention parameter vector; σ is the activation function, and the LeakyReLU function is used here for activation; || represents the concatenation operation between two feature vectors; N i Represents node t i The set of all neighbor nodes in the current graph structure; therefore, the node has two graph structures G and G k The attention scores calculated by the graph attention layer are and

[0088] Each graph attention layer uses a multi-head attention mechanism and repeats the calculation M times;

[0089] The concatenation layer is to transform the topic node t i The attention scores of all neighbor nodes are summed with feature weights to get t i Features after nonlinear transformation or The formula is as follows:

[0090]

[0091]

[0092] in, The nodes are in the graph structures G and G respectively. k The attention score of the m-th attention head; γ r(m) , γ k(m) The nodes are in the graph structures G and G respectively. kThe shared parameter matrix under the m-th attention head;

[0093] Step 5.2, feature fusion:

[0094] The feature matrix Z learned under the two graph structures r and Z k The importance of different structural semantic features is learned through the semantic attention layer:

[0095] (θ r ,θ k )=Att NN (Z r , Z k )

[0096] Among them, Att NN (Z r , Z k ) represents the attention network that learns the importance of different semantic features, θ r ,θ k are the attention coefficients of different semantic features,

[0097] For node t i , Indicates that in the matrix Z r Specifically, nonlinear transformation and normalization are used to obtain the attention coefficients of different semantic structures on the classification results of the current node.

[0098]

[0099]

[0100] Among them, W is the weight matrix, b is the bias vector, μ T To share the attention vector, the node t is transformed into i In Z r Features below Mapped to a real weight Same reason For node t i Feature matrix Z k The weights under , and then normalize the two into the final attention coefficient through the softmax function and Finally, the two features are weighted and summed by the semantic attention coefficient to obtain the final feature matrix Z':

[0101] Z′=θ r *Z r +θ k *Zk

[0102] Step 5.3: Output node classification

[0103] Send the fused feature matrix Z' to the softmax classifier to obtain the label probability value p of the data predicted by the model ij ; Use the cross entropy function to minimize the loss of the model. The formula is as follows:

[0104] Among them, C is the number of labels of topic data, y ij is the vector distribution of the true label of the topic data, p ij It is the probability value of the model's predicted label for the topic data. The label is the classification category to which the data belongs, which can measure the classification accuracy.

[0105] The topic nodes in the entire data set are divided into training set, validation set and test set in a ratio of 8:1:1; the model is trained using the training set using the stochastic gradient descent method until the loss function converges, and then the validation set is used to determine the optimal parameters of the model; the optimal model is tested using the test set;

[0106] Step 6: After the topic data to be classified has passed through steps 1-4 and then passed through the trained graph attention neural network classification model, the label of the data predicted by the model is obtained.

Claims

1. A community topic classification method based on composite network and graph attention mechanism, It is characterized in that The specific steps include: S1. Data preprocessing: Use the rule filtering library to filter irrelevant information on the acquired topic data set; S2. Extract keywords: Use an integrated algorithm to extract keywords from the preprocessed topic data, use Baidu's natural language processing tool to perform word segmentation supervision, and remove stop words and named entities; S3, initialization features: Initialize the preprocessed data and use word2vec and BiLSTM pre-training models to obtain the initial feature matrix X of the topic set T = {x 1 ,x 2 ,...,x n }; S4. Establish two graph structures: Use the preprocessed topic data set to establish a keyword-topic composite network for the entire data set, and extract two graph structures from the network: a keyword-topic relationship mapping graph structure and a topic similarity graph structure; S5. Establish a graph attention neural network classification model: and use the stochastic gradient descent method to train the model until the loss function converges, retaining the optimal parameters of the model; S6. Output node classification: After the topic data to be classified enters the trained graph attention neural network classification model, the node features are obtained, and the node features are passed through the softmax classifier to obtain the label to which the model predicts the data.

2. According to claim 1, the community topic classification method based on composite network and graph attention mechanism, It is characterized in that The specific steps of step S3 are as follows: First, use word2vec to initialize the topic t in the input layer i The word vector of topic t i The randomly initialized feature matrix X i '; Then randomly initialize the feature matrix X i ′ Input the BiLSTM pre-trained model, use the forward and backward LSTM to learn features and obtain features in two directions respectively; finally, concatenate the features in the two directions to obtain t i The eigenvector x i Based on this, we get the initial feature matrix X of the entire topic set T = {x 1 ,x 2 ,...,x n }.

3. According to claim 1, the community topic classification method based on composite network and graph attention mechanism, It is characterized in that The keyword-topic composite network in step S4 includes a sub-network of the relationship between keywords and topics and a sub-network of the similarity relationship between topics. The specific steps of establishing the two graph structures are as follows: S41. Establish a mapping graph structure of the relationship between keywords and topics: Map an undirected graph between topics and topic nodes based on the relationship subnetwork between keywords and topics. The undirected graph structure is represented by G = (A, X), where A ∈ R n×n is the symmetric adjacency matrix of the undirected graph, a ij is an element in A, a ij = 1 means that there is an edge between topic node i and topic node j, n represents the number of topic nodes, X∈R n×d is the initial feature matrix of the topic set T, and d is the dimension of the feature; S42. Establish a topic similarity graph structure: Calculate the feature similarity S between all topic nodes through cosine similarity, and then use the K nearest neighbor idea to obtain the k nodes with the greatest similarity to the current node for edge connection; finally establish an undirected graph structure G based on K nearest neighbors k =(A k , X), A k is a symmetric adjacency matrix of an undirected graph based on K nearest neighbors.

4. The community topic classification method based on composite network and graph attention mechanism according to claim 1, It is characterized in that The structure of the graph attention neural network classification model includes an input layer, a feature update layer, a feature fusion layer and an output layer, wherein the feature update layer and the feature fusion layer are connected in series; the feature update layer is two parallel graph attention neural networks, each graph attention neural network includes an input layer, two graph attention layers and a splicing layer; the feature fusion layer is a semantic attention layer, which is used to fuse the output features of the two parallel graph attention neural networks; The working principle of the graph attention neural network classification model is: S51, Feature Update: The two graph structure features established in step S3 are entered into the graph attention neural network for updating. The specific steps are as follows: S511, input the two graph structure features established in step S3 into two parallel graph attention neural networks respectively, the two parallel graph attention neural networks have the same structure and the same calculation method; S512, after two layers of graph attention layers and one layer of concatenation, the two graph structure features obtain feature matrices Z based on different graph structures respectively. r and Z k ,in is the updated feature matrix under the graph structure G = (E, X), For the graph structure G k =(A k , X) under the updated feature matrix; Among them, each graph attention layer uses the attention mechanism to calculate the neighbor node pairs <t i , t j The weight e between ij , and then use the softmax function to normalize to get the attention score α ij , the formula is as follows: e ij =σ(β T [gx i ||γx j ]) Among them, e ij Representative node t j t i The importance of ij With e ji Asymmetric between; γ∈R d×d is a shared weight matrix; β∈R 2d is the attention parameter vector; σ is the activation function, and the LeakyReLU function is used here for activation; || represents the concatenation operation between two feature vectors; N i Represents node t i The set of all neighbor nodes in the current graph structure; therefore, the node has two graph structures G and G k下 The attention scores calculated by the graph attention layer are and Each graph attention layer uses a multi-head attention mechanism and repeats the calculation M times; The concatenation layer is to transform the topic node t i The attention scores of all neighbor nodes are summed with feature weights to get t i Features after nonlinear transformation or The formula is as follows: in, The nodes are in the graph structures G and G respectively. k The attention score of the m-th attention head; γ r(m) , γ k(m) The nodes are in the graph structures G and G respectively. k The shared parameter matrix under the m-th attention head; S52, Feature Fusion: The feature matrix Z learned under the two graph structures r and Z k The importance of different structural semantic features is learned through the semantic attention layer: (θ r ,θ k )=Att NN (WITH r ,WITH k ) Among them, Att NN (Z r , Z k ) represents the attention network that learns the importance of different semantic features, θ r ,θ k are the attention coefficients of different semantic features, For node t i , Indicates that in the matrix Z r Specifically, nonlinear transformation and normalization are used to obtain the attention coefficients of different semantic structures on the classification results of the current node. Among them, W is the weight matrix, b is the bias vector, μ T To share the attention vector, the node t is transformed into i In Z r Features below Mapped to a real weight Same reason For node t i Feature matrix Z k The weights under , and then normalize the two into the final attention coefficient through the softmax function and Finally, the two features are weighted and summed by the semantic attention coefficient to obtain the final feature matrix Z': Z′=θ r *WITH r +θ k *WITH k S53, output node classification The fused feature matrix Z′ is sent to the softmax classifier to obtain the label probability value p of the data predicted by the model. ij ; Use the cross entropy function to minimize the loss of the model. The formula is as follows: Among them, C is the number of labels of topic data, y ij is the vector distribution of the true label of the topic data, p ij is the probability value of the model's predicted label for the topic data; Finally, the model is trained using the stochastic gradient descent method until the loss function converges and the optimal parameters of the model are retained.

Citation Information

Patent Citations

  • Text classification method and device, topic generation method and device, equipment and medium

    CN112380344A

  • Chinese short text classification method based on graph attention network

    CN112434720A

  • Scientific and technological innovation information classification method based on knowledge graph, and storage equipment

    CN113761208A

  • Text classification method, topic generation method, apparatus, device, and medium

    WO2022105123A1