Text classification method, device and medium based on temporal interactive graph neural network

Through the text classification method based on the time series interactive graph neural network, adaptive graph structure data is constructed and interactive attention mechanism is introduced, which solves the problem of insufficient feature extraction and expression ability of graph neural network in text classification, reduces the problem of excessive smoothing, and improves the problem of The accuracy of text classification.

CN114398479BActive Publication Date: 2024-12-20BEIJING GUOJIAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111343626.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-13
Publication Date
2024-12-20
Estimated Expiration
2041-11-13

AI Technical Summary

Technical Problem

The existing graph neural networks have problems such as insufficient feature extraction capabilities, excessive smoothing, and insufficient function expression capabilities of graph reader in text classification tasks. Especially when processing text data, it is difficult to effectively utilize the sequence relationship between words and Relative position distance.

Method used

A text classification method based on timing interactive graph neural network is proposed. By constructing adaptive graph structure data, using adaptive distance weighting algorithm to process graph nodes and edge sets, combined with timing interactive graph convolution network and gated graph neural network, we introduce Interactive attention mechanism optimizes the feature extraction and expression ability of graph neural networks, and reduces the occurrence of excessive smoothing problems.

Benefits of technology

It improves the feature extraction ability and classification accuracy of graph neural networks in text data, enhances the ability of graph reader functions to express text data, alleviates the problem of excessive smoothing, and improves the effect of text classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114398479B_ABST
    Figure CN114398479B_ABST
Patent Text Reader

Abstract

The present invention discloses a text classification method based on a temporal interactive graph neural network, the method comprising: obtaining text data and label values ​​corresponding to the text data, and constructing the text data into adaptive graph structure data; processing a graph node set and a graph directed edge set based on an adaptive distance weight algorithm to obtain an input feature matrix; inputting the input feature matrix and the label values ​​into a temporal interactive graph neural network model to obtain a total loss value of the text data; updating and optimizing the model parameters of the temporal interactive graph neural network model based on the total loss value, the cross entropy loss function and the gradient descent algorithm to obtain a training text classification model. The present invention also discloses a text classification device and a medium. The present invention can enhance the feature extraction capability of the graph neural network, improve the expression and classification of text data by the graph reader function, and reduce the probability of excessive smoothing problems in the graph neural network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural language processing technology, and in particular to a text classification method, device and medium based on a temporal interactive graph neural network. Background Art

[0002] In today's information explosion environment, how to quickly and efficiently identify the classification category from the colorful and complex text information is a technical problem with both practical value and challenges. Text classification methods can be used to solve the above problems, and the core of text classification is how to obtain a higher quality text representation. For such problems, machine learning algorithms can be used to solve them, such as logistic regression, support vector machines, and decision trees, but the ability of machine learning algorithms to extract text features needs to be enhanced. Deep learning algorithms can also be applied to text classification tasks, such as TextCNN, FAST, and BERT, but the limitations of deep learning methods are that the text representation ability is not perfect and the model training cost is high. Graph neural network is an end-to-end learning paradigm for processing non-Euclidean spatial data. It shows good performance in processing complex structures and preserving global information, and can effectively improve the shortcomings of the above algorithms. For text data, its internal structure can be regarded as a combination of complex grammatical tree structures, and the tree structure is a special form of graph structure. Therefore, graph neural network can be applied to text classification tasks.

[0003] However, existing graph neural networks for text classification tasks have some limitations, such as: the method of establishing the relationship between nodes and edges is relatively simplified when constructing text data as graph structure data, the graph neural network has the problem of over-smoothing when extracting text features, and the graph reader function has insufficient text expression ability. When constructing graph structure data, the relationship between words within a sliding window is usually considered, but the order relationship and relative position distance between words are also important; when using iterative graph neural networks to extract text features, as the number of network layers increases, although more information about local neighboring nodes can be obtained, over-smoothing problems are prone to occur; when obtaining high-level text representation, the graph reader function can be enhanced using the attention mechanism. Summary of the invention

[0004] The main purpose of the present invention is to propose a text classification method, device and medium based on a temporal interactive graph neural network, aiming to enhance the feature extraction capability of the graph neural network, improve the expression and classification of text data by the graph reader function, and reduce the probability of over-smoothing problems in the graph neural network.

[0005] To achieve the above object, the present invention provides a text classification method based on a temporal interaction graph neural network, and the text classification method based on a temporal interaction graph neural network comprises the following steps:

[0006] Acquire text data and a label value corresponding to the text data, and construct the text data into adaptive graph structure data, wherein the adaptive graph structure data includes a graph node set and a graph directed edge set;

[0007] Processing the graph node set and the graph directed edge set based on the adaptive distance weight algorithm to obtain an input feature matrix;

[0008] Inputting the input feature matrix and the label value into a time-series interactive graph neural network model to obtain a total loss value of the text data;

[0009] Based on the total loss value, the cross entropy loss function and the gradient descent algorithm, the model parameters of the temporal interaction graph neural network model are updated and optimized to obtain a training text classification model;

[0010] Obtain text data to be classified;

[0011] The text data to be classified is input into the training text classification model to obtain a text classification result.

[0012] Optionally, the step of constructing the text data into adaptive graph structure data includes:

[0013] Taking each word in the text data as a graph node set;

[0014] The co-occurrence relationship between the words is taken as a set of directed edges in a graph.

[0015] Optionally, the step of processing the graph node set and the graph directed edge set based on the adaptive distance weight algorithm to obtain an input feature matrix includes:

[0016] Obtaining an adjacency matrix and a node distance matrix according to the graph node set and the graph directed edge set;

[0017] Obtaining a unit matrix according to the adjacency matrix;

[0018] Processing the node distance matrix based on an adaptive distance weight algorithm to obtain an adaptive distance weight matrix;

[0019] Obtaining an input feature matrix according to the first learnable parameter matrix, the first learnable bias term, the unit matrix, and the adaptive distance weight matrix;

[0020] Optionally, where the adaptive distance weight matrix is ​​given by the formula Obtained; w i,j is the i-th row and j-th column element in the adaptive distance weight matrix, indicating the weight between the i-th word and the j-th word; d i,j is the element in the i-th row and j-th column of the node distance matrix, which indicates the number of words between the i-th word and the j-th word in the text plus one; i represents the row number in the adjacency matrix, and n represents the number of words in the node set;

[0021] Among them, the input feature matrix X = W K O+hI+b h ;

[0022] Among them, O is the first learnable parameter matrix, I is the identity matrix, h is the first learnable parameter term, b h For the first lesson, learn the bias term, W K is the adaptive distance weight matrix of neighboring nodes.

[0023] Optionally, the step of inputting the input feature matrix and the label value into a temporal interaction graph neural network model to obtain a total loss value of the text data comprises:

[0024] Inputting the input feature matrix into a temporal interaction graph convolutional network, and obtaining a temporal interaction convolution state matrix according to the adjacency matrix, the identity matrix and the node distance matrix;

[0025] Inputting the input feature matrix into a temporal interactive gated graph neural network, and obtaining a temporal interactive gated state matrix according to the adjacency matrix, the identity matrix and the node distance matrix;

[0026] Obtaining an enhanced feature matrix according to the temporal interaction convolution state matrix and the temporal interaction gating state matrix;

[0027] Obtaining interactive attention according to the enhanced feature matrix, the temporal interactive convolution state matrix, and the temporal interactive gating state matrix;

[0028] A total loss value of the text data is obtained according to the interactive attention and the label value.

[0029] Optionally, the step of inputting the input feature matrix into the temporal interaction graph convolutional network and obtaining a temporal interaction convolution state matrix according to the adjacency matrix, the identity matrix and the node distance matrix includes:

[0030]

[0031] C l =φ(α C AC l-1 W C+β C S C l W G +γ C );

[0032] in, is the temporal interactive convolution buffer, C i is the hidden state of the historical network layer, l is the number of iterations of the temporal interaction graph convolutional network; C l is the temporal interactive convolution state matrix, φ is the tanh activation function, and A is the symmetric normalized adjacency matrix, where D is the node distance matrix, A is the adjacency matrix, I is the identity matrix; α C is the first learnable parameter, β C is the second learnable parameter, λ i is the third learnable parameter, W C is the second learnable parameter matrix, W G is the third learnable parameter matrix, γ C is the second learnable bias term;

[0033] The step of inputting the input feature matrix into the temporal interactive gated graph neural network and obtaining a temporal interactive gated state matrix according to the adjacency matrix, the identity matrix and the node distance matrix comprises:

[0034] a k =At k-1 W a ;

[0035] z k =σ(W z a k +U z t k-1 +b z );

[0036] r k =σ(W r a k +U r t k-1 +b r );

[0037]

[0038]

[0039]

[0040]

[0041] Among them, a k is the graph feature aggregation variable obtained by symmetric normalized adjacency matrix, σ represents Sigmoid function, W a is the fourth learnable parameter matrix, W z is the fifth learnable parameter matrix, U z is the sixth learnable parameter matrix, W r is the seventh learnable parameter matrix, U r is the eighth learnable parameter matrix, W t is the ninth learnable parameter matrix, U t is the tenth learnable parameter matrix, b z is the third learnable bias term, b r is the fourth learnable bias term, b t The fifth learnable bias term, ⊙, is the multiplication of the elements at corresponding positions of the two matrices; α T is the fourth learnable parameter, β T is the fifth learnable parameter, ω j is the sixth learnable parameter, W R is the eleventh learnable parameter matrix, θ T The sixth learnable bias term, t k is the internal state, z k is the update gate, r k To reset the gate, For candidate status, is the timing interaction gated buffer, t k is the internal state of the temporal interactive gated graph neural network, T k is the sequential interaction gating state matrix;

[0042] The step of obtaining an enhanced feature matrix according to the temporal interaction convolution state matrix and the temporal interaction gating state matrix comprises:

[0043]

[0044] V A =W A H+b A ;

[0045] in, represents the i-th eigenvector of the temporal interaction convolution state matrix extracted by the temporal interaction graph convolutional network layer, Represents the temporal interaction gated state matrix T extracted through the network layer of the temporal interaction gated graph neural network k The i-th eigenvector of , || represents the concatenation of vectors; is the concatenated feature matrix; W A is the twelfth learnable parameter matrix, b Ais the seventh learnable bias term, V A To enhance the feature matrix;

[0046] Among them, interactive attention

[0047] δ represents the Softmax function, n is the number of words in the node set, and SA is the interactive attention.

[0048] Optionally, the step of obtaining a total loss value of the text data according to the interactive attention and the label value comprises:

[0049] Obtaining hidden features of a fully connected layer according to the interactive attention;

[0050] The classification probability is calculated according to the hidden features of the fully connected layer;

[0051] A total loss value of the text data is obtained according to the classification probability and the label value.

[0052] Optionally, the fully connected layer hidden feature p = φ(SA)W M ;

[0053] φ is the activation function, W M is the thirteenth learnable parameter matrix, SA is the interactive attention;

[0054] The step of calculating the classification probability according to the hidden features of the fully connected layer includes:

[0055]

[0056] f=δ(W f g+b f );

[0057] Among them, g is the graph level representation after the graph nodes are aggregated using mean, v represents a specific node in the graph node set, f is the classification probability, and δ is the Softmax function; b f is the seventh learnable bias term, W f is the fourteenth learnable parameter matrix;

[0058] Among them, the total loss value

[0059] Wherein, y is the label value of the text data.

[0060] In addition, to achieve the above-mentioned purpose, the present invention also provides a text classification device, which includes: a memory, a processor, and a text classification program stored in the memory and executable on the processor, and the text classification program implements the steps of the text classification method described above when executed by the processor.

[0061] In addition, to achieve the above-mentioned purpose, the present invention further provides a medium, on which a text classification program is stored, and when the text classification program is executed by a processor, the steps of the text classification method described above are implemented.

[0062] The present invention provides a text classification method, device and medium based on a temporal interactive graph neural network. Obtain text data and label values ​​corresponding to the text data, and construct the text data into adaptive graph structure data, wherein the adaptive graph structure data includes a graph node set and a graph directed edge set; process the graph node set and the graph directed edge set based on the adaptive distance weight algorithm to obtain an input feature matrix; input the input feature matrix and the label values ​​into a temporal interactive graph neural network model to obtain a total loss value of the text data; update and optimize the model parameters of the temporal interactive graph neural network model based on the total loss value, the cross entropy loss function and the gradient descent algorithm to obtain a training text classification model. Through the above-mentioned method, the present invention can realize the enhancement of the feature extraction capability of the graph neural network, improve the expression and classification of text data by the graph reader function, and reduce the probability of excessive smoothing problems in the graph neural network.

[0063] When constructing graph structure data, the present invention not only considers the relationship between words in a sliding window, but also introduces the word order relationship and relative position distance between words, enriches the structural information between words, and improves the relationship between nodes and edges in the graph.

[0064] The present invention can enhance the feature extraction capability of graph neural networks while alleviating the over-smoothing problem. The graph convolutional network and gated graph neural network are improved, multiple historical state information is introduced, and the parameter matrix is ​​combined to alleviate the over-smoothing problem. In addition, two improved graph neural networks are combined to extract text features at different levels to improve the distinguishability of features.

[0065] The present invention designs an interactive attention mechanism based on two different graph neural networks to enhance the importance of keywords in the text from multiple perspectives, so that the graph reader function outputs higher quality text representation. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 It is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiment of the present invention;

[0067] Figure 2 It is a flow chart of the first embodiment of the text classification method based on the temporal interactive graph neural network of the present invention;

[0068] Figure 3 It is a structural schematic diagram of the training text classification model of the present invention.

[0069] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0070] like Figure 1 As shown, Figure 1 It is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiment of the present invention.

[0071] The terminal in the embodiment of the present invention may be a PC, or may be a mobile terminal device with a display function, such as a smart phone or a tablet computer.

[0072] like Figure 1 As shown, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0073] Preferably, the terminal may also include a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and the like. Among them, sensors include light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display screen according to the brightness of the ambient light, and the proximity sensor may turn off the display screen and / or backlight when the mobile terminal is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile terminal (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; of course, the mobile terminal may also be configured with other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which will not be repeated here.

[0074] Those skilled in the art will understand that Figure 1 The terminal structure shown in the figure does not constitute a limitation on the terminal, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0075] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a text classification program.

[0076] exist Figure 1 In the terminal shown, the network interface 1004 is mainly used to connect to the backend server and perform data communication with the backend server; the user interface 1003 is mainly used to connect to the client (user end) and perform data communication with the client; and the processor 1001 can be used to call the text classification program stored in the memory 1005 and perform the following operations:

[0077] Acquire text data and a label value corresponding to the text data, and construct the text data into adaptive graph structure data, wherein the adaptive graph structure data includes a graph node set and a graph directed edge set;

[0078] Processing the graph node set and the graph directed edge set based on the adaptive distance weight algorithm to obtain an input feature matrix;

[0079] Inputting the input feature matrix and the label value into a time-series interactive graph neural network model to obtain a total loss value of the text data;

[0080] Based on the total loss value, the cross entropy loss function and the gradient descent algorithm, the model parameters of the temporal interaction graph neural network model are updated and optimized to obtain a training text classification model;

[0081] Obtain text data to be classified;

[0082] The text data to be classified is input into the training text classification model to obtain a text classification result.

[0083] Further, the processor 1001 may call the text classification program stored in the memory 1005, and when executing the operation of constructing the text data into the adaptive graph structure data, specifically perform the following operations:

[0084] Taking each word in the text data as a graph node set;

[0085] The co-occurrence relationship between the words is taken as a set of directed edges in a graph.

[0086] Further, the processor 1001 may call the text classification program stored in the memory 1005, and when performing the operation of processing the graph node set and the graph directed edge set based on the adaptive distance weight algorithm to obtain an input feature matrix, specifically perform the following operations:

[0087] Obtaining an adjacency matrix and a node distance matrix according to the graph node set and the graph directed edge set;

[0088] Obtaining a unit matrix according to the adjacency matrix;

[0089] Processing the node distance matrix based on an adaptive distance weight algorithm to obtain an adaptive distance weight matrix;

[0090] Obtaining an input feature matrix according to the first learnable parameter matrix, the first learnable bias term, the unit matrix, and the adaptive distance weight matrix;

[0091] Further, the adaptive distance weight matrix is ​​given by the formula Obtained; w i,j is the i-th row and j-th column element in the adaptive distance weight matrix, indicating the weight between the i-th word and the j-th word; d i,j is the element in the i-th row and j-th column of the node distance matrix, which indicates the number of words between the i-th word and the j-th word in the text plus one; i represents the row number in the adjacency matrix, and n represents the number of words in the node set;

[0092] Among them, the input feature matrix X = W K O+hI+b h ;

[0093] Among them, O is the first learnable parameter matrix, I is the identity matrix, h is the first learnable parameter term, b h For the first lesson, learn the bias term, WK is the adaptive distance weight matrix of neighboring nodes.

[0094] Further, the processor 1001 may call the text classification program stored in the memory 1005, and when executing the operation of inputting the input feature matrix and the label value into the temporal interaction graph neural network model to obtain the total loss value of the text data, specifically perform the following operations:

[0095] Inputting the input feature matrix into a temporal interaction graph convolutional network, and obtaining a temporal interaction convolution state matrix according to the adjacency matrix, the identity matrix and the node distance matrix;

[0096] Inputting the input feature matrix into a temporal interactive gated graph neural network, and obtaining a temporal interactive gated state matrix according to the adjacency matrix, the identity matrix and the node distance matrix;

[0097] Obtaining an enhanced feature matrix according to the temporal interaction convolution state matrix and the temporal interaction gating state matrix;

[0098] Obtaining interactive attention according to the enhanced feature matrix, the temporal interactive convolution state matrix, and the temporal interactive gating state matrix;

[0099] A total loss value of the text data is obtained according to the interactive attention and the label value.

[0100] Further,

[0101] C l =φ(α C AC l-1 W C +β C S C l W G +γ C );

[0102] in, is the temporal interactive convolution buffer, C i is the hidden state of the historical network layer, l is the number of iterations of the temporal interaction graph convolutional network; C l is the temporal interactive convolution state matrix, φ is the tanh activation function, and A is the symmetric normalized adjacency matrix, where D is the node distance matrix, A is the adjacency matrix, I is the identity matrix; α C is the first learnable parameter, β C is the second learnable parameter, λ i is the third learnable parameter, W Cis the second learnable parameter matrix, W G is the third learnable parameter matrix, γ C is the second learnable bias term;

[0103] Furthermore, a k =At k-1 W a ;

[0104] z k =σ(W z a k +U z t k-1 +b z );

[0105] r k =σ(W r a k +U r t k-1 +b r );

[0106]

[0107]

[0108]

[0109]

[0110] Among them, a k is the graph feature aggregation variable obtained by symmetric normalized adjacency matrix, σ represents Sigmoid function, W a is the fourth learnable parameter matrix, W z is the fifth learnable parameter matrix, U z is the sixth learnable parameter matrix, W r is the seventh learnable parameter matrix, U r is the eighth learnable parameter matrix, W t is the ninth learnable parameter matrix, U t is the tenth learnable parameter matrix, b z is the third learnable bias term, b r is the fourth learnable bias term, b t The fifth learnable bias term, ⊙, is the multiplication of the elements at corresponding positions of the two matrices; α T is the fourth learnable parameter, β T is the fifth learnable parameter, ω j is the sixth learnable parameter, W R is the eleventh learnable parameter matrix, θ T The sixth learnable bias term, t kis the internal state, z k is the update gate, r k To reset the gate, For candidate status, is the timing interaction gated buffer, t k is the internal state of the temporal interactive gated graph neural network, T k is the sequential interaction gating state matrix;

[0111] Further,

[0112] V A =W A H+b A ;

[0113] in, represents the i-th eigenvector of the temporal interaction convolution state matrix extracted by the temporal interaction graph convolutional network layer, Represents the temporal interaction gated state matrix T extracted through the network layer of the temporal interaction gated graph neural network k The i-th eigenvector of , || represents the concatenation of vectors; is the concatenated feature matrix; W A is the twelfth learnable parameter matrix, b A is the seventh learnable bias term, V A To enhance the feature matrix;

[0114] Furthermore, the interactive attention

[0115] δ represents the Softmax function, n is the number of words in the node set, and SA is the interactive attention.

[0116] Further, the processor 1001 may call the text classification program stored in the memory 1005, and when executing the operation of obtaining the total loss value of the text data according to the interactive attention and the label value, specifically perform the following operations:

[0117] Obtaining hidden features of a fully connected layer according to the interactive attention;

[0118] The classification probability is calculated according to the hidden features of the fully connected layer;

[0119] A total loss value of the text data is obtained according to the classification probability and the label value.

[0120] Furthermore, the fully connected layer hidden feature p = φ(SA)W M ;

[0121] φ is the activation function, WM is the thirteenth learnable parameter matrix, SA is the interactive attention;

[0122] The step of calculating the classification probability according to the hidden features of the fully connected layer includes:

[0123]

[0124] f=δ(W f g+b f );

[0125] Among them, g is the graph level representation after the graph nodes are aggregated using mean, v represents a specific node in the graph node set, f is the classification probability, and δ is the Softmax function; b f is the seventh learnable bias term, W f is the fourteenth learnable parameter matrix;

[0126] Among them, the total loss value

[0127] Wherein, y is the label value of the text data.

[0128] Based on the above hardware structure, an embodiment of a text classification method based on a temporal interactive graph neural network of the present invention is proposed.

[0129] Reference Figure 2 , Figure 2 It is a flowchart of the first embodiment of the text classification method based on the temporal interactive graph neural network of the present invention.

[0130] In an embodiment of the present invention, the text classification method based on the temporal interaction graph neural network is applied to a text classification device, and the text classification method based on the temporal interaction graph neural network includes:

[0131] Step S10, obtaining text data and label values ​​corresponding to the text data, and constructing the text data into adaptive graph structure data, wherein the adaptive graph structure data includes a graph node set and a graph directed edge set;

[0132] In this embodiment, in order to enhance the feature extraction capability of the graph neural network, improve the expression and classification of the graph reader function on the text data, and reduce the probability of the over-smoothing problem in the graph neural network; the text classification device first obtains the text data and the label value corresponding to the text data, and constructs the text data into adaptive graph structure data. The adaptive graph structure data includes a graph node set V and a graph directed edge set E. The label value can be science and technology, humanities, etc., that is, the classification of the text data can be science and technology, or humanities, etc.

[0133] Step S10 constructs the text data into adaptive graph structure data, which may include:

[0134] Step S11, taking each word in the text data as a graph node set;

[0135] In this embodiment, after obtaining the text data and the label value corresponding to the text data, the text classification device uses each word in the text data as a graph node set V;

[0136] Step S12, taking the co-occurrence relationship between the words as a graph directed edge set;

[0137] In this embodiment, after obtaining the text data and the label value corresponding to the text data, the text classification device uses the co-occurrence relationship between the words as a graph directed edge set E; wherein the co-occurrence relationship is the relationship between the words that exist simultaneously in a sliding window with a dynamically changing length; wherein the length of the sliding window is one third of the number of nodes contained in the text data. (The length of the sliding window is at least 1). wherein the node is composed of words obtained after the sentence is segmented and duplicated; a node represents a word after duplicated. thus, an adaptive directed graph structure (i.e., adaptive graph structure data) is constructed according to the graph node set V and the graph directed edge set E. the length of the sliding window varies according to the number of nodes in the graph, for example, in this sentence of text data, it has three words (nodes), it has five words (nodes), and it has ten words (nodes), then the length of the sliding window is different, (before determining the length of the sliding window, the text is segmented first, and then the repeated words in it are removed, and a number of non-repeated words are obtained, that is, a number of nodes are obtained). the length of the sliding window will only vary according to the number of words in the node text. If there are ten words in the node text, the length of the sliding window is 10 times one third. When constructing graph structure data, not only the relationship between words in a sliding window is considered, but also the word order relationship and relative position distance between words are introduced, which enriches the structural information between words and improves the relationship between nodes and edges in the graph.

[0138] Step S20, processing the graph node set and the graph directed edge set based on the adaptive distance weight algorithm to obtain an input feature matrix;

[0139] In this embodiment, after obtaining the graph node set V and the graph directed edge set E, the text classification device processes the graph node set and the graph directed edge set based on the adaptive distance weight algorithm to obtain an input feature matrix.

[0140] Step S20 processes the graph node set and the graph directed edge set based on the adaptive distance weight algorithm to obtain an input feature matrix, which may include:

[0141] Step S21, obtaining an adjacency matrix A and a node distance matrix D according to the graph node set and the graph directed edge set;

[0142] In this embodiment, after obtaining the graph node set V and the graph directed edge set E, the text classification device obtains the adjacency matrix A and the node distance matrix D according to the graph node set V and the graph directed edge set E; wherein the node distance matrix D is the node distance matrix D related to the words, and the node distance matrix D related to the words is calculated based on the co-occurrence relationship between the words in the sliding window, that is, the node distance matrix D is calculated through the positional relationship between the words.

[0143] Step S22, obtaining a unit matrix according to the adjacency matrix;

[0144] In this embodiment, after obtaining the adjacency matrix A, the text classification device obtains a unit matrix according to the adjacency matrix A; wherein the unit matrix I corresponds to the adjacency matrix A.

[0145] Step S23, processing the node distance matrix based on an adaptive distance weight algorithm to obtain an adaptive distance weight matrix;

[0146] In this embodiment, after obtaining the node distance matrix D, the text classification device processes the node distance matrix D according to the adaptive distance weight algorithm to obtain the adaptive distance weight matrix W of the adjacent nodes. K ;

[0147] Among them, the adaptive distance weight matrix W K By formula Obtained; w i,j It is W K The element in the i-th row and j-th column in represents the weight of the i-th word and the j-th word; d i,j It is the element in the i-th row and j-th column of the node distance matrix D, which represents the number of words between the i-th word and the j-th word in the text plus one; i represents the row number in the adjacency matrix, and n represents the number of words in the node set.

[0148] Step S24, obtaining an input feature matrix according to the first learnable parameter matrix, the first learnable bias term, the unit matrix, and the adaptive distance weight matrix.

[0149] In this embodiment, after obtaining the unit matrix I and the node distance matrix D, the text classification device uses the first learnable parameter matrix O and the first learnable bias term bh And the unit matrix I, the adaptive distance weight matrix W K , and get the input feature matrix X.

[0150] Among them, the input feature matrix X = W K O+hI+b h ;

[0151] Among them, O is the first learnable parameter matrix, I is the identity matrix, h is the first learnable parameter term, b h For the first lesson, learn the bias term, W K is the adaptive distance weight matrix of neighboring nodes.

[0152] Step S30, inputting the input feature matrix and the label value into a temporal interaction graph neural network model to obtain a total loss value of the text data;

[0153] In this embodiment, after obtaining the input feature matrix, adjacency matrix, unit matrix, node distance matrix and label value, the text classification device inputs the input feature matrix, the adjacency matrix, the unit matrix, the node distance matrix and the label value into the temporal interactive graph neural network model to obtain the total loss value of the text data. This embodiment can alleviate the over-smoothing problem while enhancing the feature extraction capability of the graph neural network. Improvements are made to the graph convolutional network and the gated graph neural network, introducing information on multiple historical states and combining parameter matrices to alleviate the over-smoothing problem. In addition, two improved graph neural networks are combined to extract text features at different levels to improve the distinctiveness of the features. Among them, such as Figure 3 As shown, the training text classification model is a time-series interaction graph neural network model. Among them, the time-series interaction graph neural network model includes an adaptive graph structure data construction layer, an adaptive distance weight calculation layer, and two parallel time-series interaction graph convolutional networks and time-series interaction gated graph neural networks, an interactive attention calculation layer, and a total loss value calculation layer. The specific structural schematic diagram of the time-series interaction graph neural network model can also refer to all the detailed steps of step S30 and step S40. All the detailed steps of step S30 and step S40 are executed when the time-series interaction graph neural network model is trained. When the time-series interaction graph neural network model is tested and predicted (that is, when executing step S60), all the detailed steps of step S31, step S32, step S33, step S34, step S351, and step S352 are executed to obtain the classification probability, that is, the category of the text data with the highest probability is used as the prediction result.

[0154] Step S30 inputs the input feature matrix and the label value into the temporal interaction graph neural network model to obtain the total loss value of the text data, which may include:

[0155] Step S31, inputting the input feature matrix into the temporal interaction graph convolutional network, and obtaining a temporal interaction convolution state matrix according to the adjacency matrix, the unit matrix and the node distance matrix;

[0156] In this embodiment, after obtaining the input feature matrix, the adjacency matrix, the unit matrix and the node distance matrix, the text classification device inputs the input feature matrix X into the temporal interactive graph convolution network SIGCN, and obtains the temporal interactive convolution state matrix C according to the adjacency matrix, the unit matrix and the node distance matrix. l In the graph convolutional network (GCN), as the number of network layers increases, the information loss of the central node increases during network iteration, resulting in local over-smoothing of the connected components containing the central node. In order to highlight the information of the central node itself while receiving information from high-order neighbor nodes, the temporal interactive graph convolutional network (SIGCN) is used to alleviate the above problem. Temporal interactive convolution cache It explicitly adds the historical hidden states of several previous network layers to the current network layer to enhance the current network layer. l The multi-layer parameter matrix of GCN is replaced with a single-layer parameter matrix with parameter sharing to reduce the risk of overfitting in the network.

[0157] Step S31 inputs the input feature matrix into the temporal interaction graph convolutional network, and obtains a temporal interaction convolution state matrix according to the adjacency matrix, the identity matrix and the node distance matrix, which may include:

[0158]

[0159] C l =φ(α C AC l-1 W C +β C S C l W G +γ C );

[0160] in, is the temporal interactive convolution buffer, C i is the hidden state of the historical network layer, l is the number of iterations of the temporal interaction graph convolutional network; at the initial iteration, there is C 0 =X, l represents the maximum number of iterations of the network, l≥1. l is the temporal interactive convolution state matrix, φ is the tanh activation function, and A is the symmetric normalized adjacency matrix, where D is the node distance matrix, A is the adjacency matrix, I is the unit matrix corresponding to the adjacency matrix A; αC is the first learnable parameter of the temporal interaction graph convolutional network SIGCN, β C is the second learnable parameter, λ i is the third learnable parameter, λ i The weight of each hidden layer of the network is a learnable parameter, W C is the second learnable parameter matrix, W G is the third learnable parameter matrix, γ C is the second learnable bias term;

[0161] Step S32, inputting the input feature matrix into a temporal interactive gated graph neural network, and obtaining a temporal interactive gated state matrix according to the adjacency matrix, the unit matrix and the node distance matrix;

[0162] In this embodiment, after obtaining the input feature matrix, the adjacency matrix, the unit matrix and the node distance matrix, the text classification device inputs the input feature matrix into the temporal interactive gated graph neural network SIGGNN, and obtains the temporal interactive gated state matrix T according to the adjacency matrix, the unit matrix and the node distance matrix. k . The advantage of the gated graph neural network GGNN is that it can effectively capture the contextual dependencies in the text, but the iterative training method also makes it have the problem of local over-smoothing of connected components when extracting hidden features. In order to enhance the information of the central node, multi-step historical states are also introduced to enhance the current network layer state and alleviate the over-smoothing problem. The difference is that according to the characteristics of the GGNN network layer, SIGGNN introduces the historical hidden state of the network layer after the hidden feature extraction is completed using the update gate unit and the reset gate unit, so as to ensure that while enhancing the hidden features of the current network layer, it avoids affecting the normal information transmission and update between nodes.

[0163] Step S32 inputs the input feature matrix into the temporal interactive gated graph neural network, and obtains a temporal interactive gated state matrix according to the adjacency matrix, the identity matrix and the node distance matrix, which may include:

[0164] a k =At k-1 W a ;

[0165] z k =σ(W z a k +U z t k-1 +b z );

[0166] r k =σ(W r ak +U r t k-1 +b r );

[0167]

[0168]

[0169]

[0170]

[0171] Among them, a k is the graph feature aggregation variable obtained with the help of the symmetric normalized adjacency matrix, A is the symmetric normalized adjacency matrix, where D is the node distance matrix, A is the adjacency matrix, I is the unit matrix corresponding to the adjacency matrix A; σ represents the Sigmoid function, W a is the fourth learnable parameter matrix, W z is the fifth learnable parameter matrix, U z is the sixth learnable parameter matrix, W r is the seventh learnable parameter matrix, U r is the eighth learnable parameter matrix, W t is the ninth learnable parameter matrix, U t is the tenth learnable parameter matrix, b z is the third learnable bias term, b r is the fourth learnable bias term, b t The fifth is the learnable bias term. ⊙ is the multiplication of the elements of the corresponding positions of the two matrices; for example, the first row and first column of the first matrix is ​​multiplied by the first row and first column of the second matrix, and the first row and second column of the first matrix is ​​multiplied by the first row and second column of the second matrix. After all the corresponding positions of the two matrices are multiplied, the result matrix of the multiplication of the two matrices is obtained. At the initial iteration, there is T 0 =X, k represents the maximum number of iterations of the network, k≥1.

[0172] Among them, α T is the fourth learnable parameter, β T is the fifth learnable parameter, ω j is the sixth learnable parameter, W R is the eleventh learnable parameter matrix, θ T The sixth learnable bias term, t k is the internal state, z k is the update gate, r k To reset the gate, For candidate status, is the timing interaction gated buffer, t k is the internal state of the temporal interactive gated graph neural network, T k is the timing interaction gating state matrix.

[0173] Step S33, obtaining an enhanced feature matrix according to the temporal interaction convolution state matrix and the temporal interaction gating state matrix;

[0174] In this embodiment, the text classification device obtains the temporal interactive convolution state matrix C l and the timing interaction gate state matrix T k Afterwards, the state matrix C is interactively convolved according to the timing l and the timing interaction gating state matrix T k , and get the enhanced feature matrix V A .

[0175] Step S33 obtains an enhanced feature matrix according to the temporal interaction convolution state matrix and the temporal interaction gating state matrix, which may include:

[0176]

[0177] V A =W A H+b A ;

[0178] in, represents the i-th eigenvector of the temporal interaction convolution state matrix extracted by the temporal interaction graph convolutional network layer, Represents the temporal interaction gated state matrix T extracted through the network layer of the temporal interaction gated graph neural network k The i-th eigenvector of , || represents the concatenation of vectors, where represents an m-dimensional real-valued vector, and R represents a set of real numbers; is the concatenated feature matrix obtained by concatenation; W A is the twelfth learnable parameter matrix, b A is the seventh learnable bias term, V A To enhance the feature matrix;

[0179] Step S34, obtaining interactive attention according to the enhanced feature matrix, the temporal interactive convolution state matrix and the temporal interactive gating state matrix;

[0180] In this embodiment, the text classification device obtains the enhanced feature matrix V A , the temporal interactive convolution state matrix C l and the timing interaction gating state matrix T kAfterwards, according to the enhanced feature matrix, the time-series interactive convolution state matrix C l and the timing interaction gating state matrix T k Get interactive attention SA.

[0181] Among them, interactive attention

[0182] δ represents the Softmax function, n is the number of words in the node set V, SA is the interactive attention; V A is the enhanced feature matrix, C l is the temporal interactive convolution state matrix, T k is the sequential interaction gating state matrix. l C lT The importance matrix T is calculated for the temporal interactive convolution state matrix using matrix multiplication; k T kT The importance matrix is ​​calculated separately for the temporal interaction gating state matrix using matrix multiplication; then the temporal interaction convolution state matrix C l and the timing interaction gating state matrix T k Splice together to get the spliced ​​feature matrix H; V A V A T is the enhanced feature matrix V A Use matrix multiplication to calculate the importance matrix separately; finally, these three importance matrices (that is, C l C lT 、T k T kT and V A V A T ) are accumulated together to calculate the interactive attention weights, which are applied to the graph reader function to obtain the probability distribution of text categories. This scheme designs an interactive attention mechanism based on two different graph neural networks (the two neural networks are the temporal interactive gated graph neural network SIGGNN and the temporal interactive graph convolutional network SIGCN) to enhance the importance of keywords in the text from multiple perspectives, so that the graph reader function can output higher quality text representation.

[0183] Step S35, obtaining a total loss value of the text data according to the interactive attention and the label value.

[0184] In this embodiment, after obtaining the interactive attention SA and the label value of the text data, the text classification device obtains the total loss value of the text data according to the interactive attention and the label value. .

[0185] Step S35 obtains the total loss value of the text data according to the interactive attention and the label value, which may include:

[0186] Step S351, obtaining fully connected layer hidden features according to the interactive attention;

[0187] In this embodiment, after obtaining the interactive attention SA, the text classification device obtains the fully connected layer hidden features according to the interactive attention.

[0188] Among them, the hidden feature of the fully connected layer p = φ(SA)W M ;

[0189] p is the hidden feature passed through the fully connected layer, φ is the activation function, W M is the thirteenth learnable parameter matrix, SA is the interactive attention;

[0190] Step S352, calculating the classification probability according to the hidden features of the fully connected layer;

[0191] In this embodiment, after obtaining the hidden features p of the fully connected layer, the text classification device calculates the classification probability f according to the hidden features p of the fully connected layer.

[0192] Step S352 calculates the classification probability according to the hidden features of the fully connected layer, which may include:

[0193]

[0194] f=δ(W f g+b f );

[0195] Among them, g is the graph level representation after the graph nodes are aggregated using the mean, v represents a specific node in the graph node set V, f is the predicted probability obtained after passing through the fully connected layer and the Softmax function (that is, the classification probability of the text data), and δ is the Softmax function; b f is the seventh learnable bias term, W f is the fourteenth learnable parameter matrix;

[0196] Step S353, obtaining a total loss value of the text data according to the classification probability and the label value.

[0197] Among them, the total loss value

[0198] in, That is, it is the total loss value of the current batch of text data, and y is the label value of the text data.

[0199] Step S40, updating and optimizing the model parameters of the temporal interaction graph neural network model based on the total loss value, the cross entropy loss function and the gradient descent algorithm to obtain a training text classification model;

[0200] In this embodiment, the text classification device obtains the total loss value Afterwards, the model parameters of the temporal interaction graph neural network model are updated and optimized based on the total loss value, the cross entropy loss function and the gradient descent algorithm to obtain a training text classification model. During model training, the loss value of the current text is calculated using the cross entropy loss function based on the classification probability f of the obtained text data and the label value y corresponding to the text data, and the loss value of each text is added to obtain the total loss. Then use the gradient descent algorithm to update and optimize the model parameters of the temporal interaction graph neural network model to obtain the first optimized temporal interaction graph neural network model. When the model parameters of the first optimized temporal interaction graph neural network model converge, the first optimized temporal interaction graph neural network model is used as a training text classification model. When the model parameters of the time-series interaction graph neural network model after the first optimization have not converged, the second text data in the text data and the second label value corresponding to the second text data can be obtained according to step S10, and the second text data can be constructed as the second adaptive graph structure data, wherein the second adaptive graph structure data includes the second graph node set and the second graph directed edge set; then, according to step S20, the second graph node set and the second graph directed edge set are processed based on the adaptive distance weight algorithm to obtain the second input feature matrix; then, according to step S30, the second input feature matrix and the second label value are input into the time-series interaction graph neural network model after the first optimization to obtain the second total loss value of the second text data; then, according to step S40, the model parameters of the time-series interaction graph neural network model after the first optimization are updated and optimized based on the second total loss value, the cross entropy loss function and the gradient descent algorithm to obtain the time-series interaction graph neural network model after the second optimization. By analogy, when the model parameters of the time-series interaction graph neural network model after the Nth optimization converge, the time-series interaction graph neural network model after the Nth optimization is used as the training text classification model.

[0201] Step S50, obtaining text data to be classified;

[0202] In this embodiment, after training the text classification model, the text classification device obtains the text data to be classified.

[0203] Step S60, inputting the text data to be classified into the training text classification model to obtain a text classification result.

[0204] In this embodiment, after obtaining the text data to be classified, the text classification device inputs the text data to be classified into the training text classification model to obtain the text classification result. During the model prediction, the text category with the highest probability is directly selected as the prediction result according to the text category probability distribution output by the network. For example, the category of the text data is science and technology or humanities.

[0205] This embodiment uses the above scheme to obtain text data and the label value corresponding to the text data, and construct the text data into adaptive graph structure data, wherein the adaptive graph structure data includes a graph node set and a graph directed edge set; based on the adaptive distance weight algorithm, the graph node set and the graph directed edge set are processed to obtain an input feature matrix; the input feature matrix and the label value are input into the temporal interactive graph neural network model to obtain the total loss value of the text data; based on the total loss value, the cross entropy loss function and the gradient descent algorithm, the model parameters of the text classification model are updated and optimized to obtain a training text classification model. In this way, the feature extraction capability of the graph neural network is enhanced, the expression and classification of the text data by the graph reader function is improved, and the probability of the over-smoothing problem in the graph neural network is reduced. The text data to be classified is classified, and the accuracy of the text data to be classified is improved.

[0206] The invention also provides a text classification device.

[0207] The text classification device of the present invention comprises: a memory, a processor and a text classification program stored in the memory and executable on the processor. When the text classification program is executed by the processor, the steps of the text classification method described above are implemented.

[0208] Among them, the method implemented when the text classification program running on the processor is executed can refer to the various embodiments of the text classification method of the present invention, and will not be repeated here.

[0209] The present invention also provides a medium.

[0210] The medium of the present invention stores a text classification program, and when the text classification program is executed by a processor, the steps of the text classification method described above are implemented.

[0211] Among them, the method implemented when the text classification program running on the processor is executed can refer to the various embodiments of the text classification method of the present invention, and will not be repeated here.

[0212] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0213] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0214] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0215] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A text classification method based on a temporal interactive graph neural network, characterized by: The text classification method based on temporal interactive graph neural network comprises the following steps: Acquire text data and a label value corresponding to the text data, and construct the text data into adaptive graph structure data, wherein the adaptive graph structure data includes a graph node set and a graph directed edge set; Processing the graph node set and the graph directed edge set based on the adaptive distance weight algorithm to obtain an input feature matrix; Inputting the input feature matrix and the label value into a time-series interactive graph neural network model to obtain a total loss value of the text data; Based on the total loss value, the cross entropy loss function and the gradient descent algorithm, the model parameters of the temporal interaction graph neural network model are updated and optimized to obtain a training text classification model; Obtain the text data to be classified; The step of inputting the text data to be classified into the training text classification model to obtain a text classification result; and processing the graph node set and the graph directed edge set based on the adaptive distance weight algorithm to obtain an input feature matrix comprises: Obtaining an adjacency matrix and a node distance matrix according to the graph node set and the graph directed edge set; Obtaining a unit matrix according to the adjacency matrix; Processing the node distance matrix based on an adaptive distance weight algorithm to obtain an adaptive distance weight matrix; Obtaining an input feature matrix according to the first learnable parameter matrix, the first learnable bias term, the unit matrix, and the adaptive distance weight matrix; Among them, the adaptive distance weight matrix is ​​given by the formula Obtained; w i,j is the i-th row and j-th column element in the adaptive distance weight matrix, indicating the weight between the i-th word and the j-th word; d i,j is the element in the i-th row and j-th column of the node distance matrix, which indicates the number of words between the i-th word and the j-th word in the text plus one; i represents the row number in the adjacency matrix, and n represents the number of words in the node set; Among them, the input feature matrix X = W K O+hI+b h ; Among them, O is the first learnable parameter matrix, I is the identity matrix, h is the first learnable parameter term, b h is the first learnable bias term, W K is the adaptive distance weight matrix of adjacent nodes; The step of inputting the input feature matrix and the label value into the time series interactive graph neural network model to obtain the total loss value of the text data includes: Inputting the input feature matrix into a temporal interaction graph convolutional network, and obtaining a temporal interaction convolution state matrix according to the adjacency matrix, the identity matrix and the node distance matrix; Inputting the input feature matrix into a temporal interactive gated graph neural network, and obtaining a temporal interactive gated state matrix according to the adjacency matrix, the identity matrix and the node distance matrix; Obtaining an enhanced feature matrix according to the temporal interaction convolution state matrix and the temporal interaction gating state matrix; Obtaining interactive attention according to the enhanced feature matrix, the temporal interactive convolution state matrix, and the temporal interactive gating state matrix; Obtaining a total loss value of the text data according to the interactive attention and the label value; The step of inputting the input feature matrix into the temporal interaction graph convolutional network and obtaining the temporal interaction convolution state matrix according to the adjacency matrix, the identity matrix and the node distance matrix comprises: C l =φ(a C AC l-1 W C +b C S C l W G +g C ); in, is the temporal interactive convolution buffer, C i is the hidden state of the historical network layer, l is the number of iterations of the temporal interaction graph convolutional network; C l is the temporal interactive convolution state matrix, φ is the tanh activation function, and A is the symmetric normalized adjacency matrix, where D is the node distance matrix, A is the adjacency matrix, I is the identity matrix; α C is the first learnable parameter, β C is the second learnable parameter, λ i is the third learnable parameter, W C is the second learnable parameter matrix, W G is the third learnable parameter matrix, γ C is the second learnable bias term; The step of inputting the input feature matrix into the temporal interactive gated graph neural network and obtaining a temporal interactive gated state matrix according to the adjacency matrix, the identity matrix and the node distance matrix comprises: a k =At k-1 W a ; z k =σ(W z a k +U z t k-1 +b z ); r k =σ(W r a k +U r t k-1 +b r ); Among them, a k is the graph feature aggregation variable obtained by symmetric normalized adjacency matrix, σ represents Sigmoid function, W a is the fourth learnable parameter matrix, W z is the fifth learnable parameter matrix, U z is the sixth learnable parameter matrix, W r is the seventh learnable parameter matrix, U r is the eighth learnable parameter matrix, W t is the ninth learnable parameter matrix, U t is the tenth learnable parameter matrix, b z is the third learnable bias term, b r is the fourth learnable bias term, b t The fifth learnable bias term is the multiplication of the elements at corresponding positions of the two matrices; α T is the fourth learnable parameter, β T is the fifth learnable parameter, ω j is the sixth learnable parameter, W R is the eleventh learnable parameter matrix, θ T The sixth learnable bias term, t k is the internal state, z k is the update gate, r k To reset the gate, For candidate status, is the timing interaction gated buffer, t k is the internal state of the temporal interactive gated graph neural network, T k is the sequential interaction gating state matrix; The step of obtaining an enhanced feature matrix according to the temporal interaction convolution state matrix and the temporal interaction gating state matrix comprises: V A =W A H+b A ; in, represents the i-th eigenvector of the temporal interaction convolution state matrix extracted by the network layer of the temporal interaction graph convolutional network, Represents the temporal interaction gated state matrix T extracted through the network layer of the temporal interaction gated graph neural network k The i-th eigenvector of represents the concatenation of vectors; is the concatenated feature matrix; W A is the twelfth learnable parameter matrix, b A is the seventh learnable bias term, V A To enhance the feature matrix; Among them, interactive attention δ represents the Softmax function, n is the number of words in the node set, and SA is the interactive attention; The step of obtaining a total loss value of the text data according to the interactive attention and the label value comprises: Obtaining hidden features of a fully connected layer according to the interactive attention; The classification probability is calculated according to the hidden features of the fully connected layer; Obtain a total loss value of the text data according to the classification probability and the label value; Among them, the fully connected layer hidden feature p = φ (SA) W M ; φ is the activation function, W M is the thirteenth learnable parameter matrix, SA is the interactive attention; The step of calculating the classification probability according to the hidden features of the fully connected layer includes: f=δ(W f g+b f ); Among them, g is the graph level representation after the graph nodes are aggregated using mean, v represents a specific node in the graph node set, f is the classification probability, and δ is the Softmax function; b f is the seventh learnable bias term, W f is the fourteenth learnable parameter matrix; Among them, the total loss value Wherein, y is the label value of the text data.

2. The text classification method based on temporal interactive graph neural network according to claim 1 is characterized in that: The step of constructing the text data into adaptive graph structure data comprises: Taking each word in the text data as a graph node set; The co-occurrence relationship between the words is taken as a set of directed edges in a graph.

3. A text classification device, characterized in that: The text classification device comprises: a memory, a processor, and a text classification program stored in the memory and running on the processor. When the text classification program is executed by the processor, the steps of the text classification method according to claim 1 or 2 are implemented.

4. A computer-readable storage medium, characterized in that: The medium stores a text classification program, and when the text classification program is executed by the processor, the steps of the text classification method according to claim 1 or 2 are implemented.