Emotion classification method, system, device and storage medium for network social dynamics

By constructing social dynamic multi-layer maps and processing them using an integrated model, the problem of insufficient accuracy of social dynamic emotion recognition in the prior art is solved, and a higher accuracy of emotion classification is achieved.

CN119293219BActive Publication Date: 2025-03-18ZHEJIANG LAB
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411805809.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-03-18
Estimated Expiration
2044-12-10

AI Technical Summary

Technical Problem

The prior art has problems with insufficient accuracy in the recognition of emotions in social dynamics, especially when dealing with short and noisy texts, it is difficult to fully understand text semantics.

Method used

By constructing a semantic graph containing word nodes and social dynamic nodes, and combining the correlation information between social dynamics, a social dynamic multi-layer graph is established. Then, using an integrated model of hyperbolic learning-based graph convolutional neural network and a large-scale pre-trained language model, social dynamic multi-layer graphs are processed to obtain emotional classification results.

Benefits of technology

It improves the accuracy of emotional classification of social dynamics, can better understand and represent emotions in social dynamics, and overcomes the shortcomings of the prior art in short text and noisy text processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119293219B_ABST
    Figure CN119293219B_ABST
Patent Text Reader

Abstract

The present application relates to a method, system, device and storage medium for sentiment classification of online social dynamics. The method comprises the following steps: preprocessing the text of the social dynamics to obtain a preprocessed data set; constructing a semantic graph including word nodes and social dynamics nodes based on the data set; extracting correlation information between the social dynamics based on the topic attributes of the social dynamics and the relationships between users who publish the social dynamics, and establishing connection relationships between the social dynamics nodes based on the correlation information between the social dynamics to obtain a social dynamics multi-layer graph including semantic relationships and social relationships; inputting the social dynamics multi-layer graph into an integrated model for processing to obtain a sentiment classification result of the social dynamics; wherein the integrated model is composed of a graph convolutional neural network based on hyperbolic learning and a large-scale pre-trained language model; and improving the accuracy of sentiment classification of social dynamics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and in particular to a method, system, device and storage medium for classifying emotions in network social dynamics. Background Art

[0002] With the rapid development of Internet technology, user-generated content on online social media such as Twitter and Sina Weibo has exploded. In-depth mining and analysis of these fragmented contents to obtain accurate user sentiment information can provide a data foundation for important applications such as recommendation systems and public opinion guidance, which has become an important demand.

[0003] Most current emotion recognition methods for social dynamics start from the text side, focusing on improving the representation ability of text and building more effective text analysis models. However, social dynamics are short and noisy, containing a large number of abbreviations, slang and informal words, and emotion recognition methods in related technologies often cannot fully understand the text semantics.

[0004] Currently, no effective solution has been proposed to address the problem of inaccurate emotion recognition of social dynamics in related technologies. Summary of the invention

[0005] Based on this, it is necessary to provide a more accurate sentiment classification method, system, device and storage medium for network social dynamics in response to the above technical problems.

[0006] In a first aspect, the present application provides a method for classifying sentiment of network social dynamics, comprising:

[0007] Preprocess the text of social dynamics to obtain a preprocessed data set;

[0008] Constructing a semantic graph including word nodes and social dynamic nodes according to the data set; wherein the word nodes are connected based on a word co-occurrence mechanism, and the social dynamic nodes are connected based on the word nodes;

[0009] Extracting association information between the social dynamics according to topic attributes of the social dynamics and relationships between users who publish the social dynamics, and establishing connection relationships between the social dynamics nodes according to the association information between the social dynamics, to obtain a social dynamics multi-layer graph including semantic relationships and social relationships;

[0010] The social dynamics multi-layer graph is input into an integrated model for processing to obtain a sentiment classification result of the social dynamics; wherein the integrated model is composed of a graph convolutional neural network based on hyperbolic learning and a large-scale pre-trained language model.

[0011] In one embodiment, constructing a semantic graph including word nodes and social dynamic nodes according to the data set includes:

[0012] Using a window with a preset step length to cut sentences in the text, and counting the frequency of a single word appearing in the window and the frequency of two words co-occurring;

[0013] Calculate the connection weight between the word nodes according to the frequency of occurrence of the single word in the window and the frequency of co-occurrence of two words;

[0014] The connection weight between the social dynamic node and the word node is calculated according to the TF-IDF information of the single word.

[0015] In one embodiment, extracting association information between the social dynamics according to topic attributes of the social dynamics and relationships between users who posted the social dynamics includes:

[0016] Determining whether the first social dynamic and the second social dynamic are posted by the same user on the same topic;

[0017] If the first social dynamic and the second social dynamic are posted by the same user on the same topic, confirming that the sentiment labels of the first social dynamic and the second social dynamic are consistent; and / or,

[0018] Determining whether the first social dynamic and the second social dynamic are posted by similar users on the same topic;

[0019] If the first social dynamics and the second social dynamics are posted by similar users on the same topic, it is confirmed that the sentiment labels of the first social dynamics and the second social dynamics are consistent.

[0020] In one embodiment, after confirming that the emotion labels of the first social dynamic and the second social dynamic are consistent, the method further includes:

[0021] A connection relationship between a first social dynamic node and a second social dynamic node is established to obtain a social dynamic relationship matrix; wherein the first social dynamic node corresponds to the first social dynamic, and the second social dynamic node corresponds to the second social dynamic.

[0022] In one embodiment, the social dynamic multi-layer graph is input into an integrated model for processing, including:

[0023] generating a multi-dimensional vector according to the large-scale pre-trained language model to initialize social dynamic nodes in the social dynamic multi-layer graph;

[0024] Initializing word nodes in the social dynamics multi-layer graph based on zero vectors;

[0025] Mapping the feature vectors of the social dynamic node and the word node from the Euclidean space to a hyperbolic space with multiple curvatures;

[0026] Stacking multiple layers of graph convolution, converting and aggregating the embedded representations of the neighboring nodes of the central node in the tangent space of each layer of graph convolution, and mapping the processing results to the hyperbolic space;

[0027] Performing neighbor aggregation processing on neighbor nodes of the central node based on the attention mechanism;

[0028] According to the hyperbolic curvatures of different graph convolutional layers in the hyperbolic space, nonlinear activation values ​​in the graph convolutional neural network are calculated.

[0029] In one embodiment, after calculating the nonlinear activation value in the graph convolutional neural network according to the hyperbolic curvature of different graph convolutional layers in the hyperbolic space, the method further includes:

[0030] Weighting the predicted values ​​output by the graph convolutional neural network and the large-scale pre-trained language model according to preset output weights to obtain a predicted value;

[0031] A sentiment classification result of the text is obtained based on the prediction value.

[0032] In one embodiment, after obtaining the sentiment classification result of the text based on the prediction value, the method further includes:

[0033] Calculate the cross entropy loss between the predicted value and the true label;

[0034] Model parameters of the ensemble model are adjusted according to the cross entropy loss.

[0035] In a second aspect, the present application provides a network social dynamics sentiment classification system, comprising:

[0036] A text preprocessing module is used to preprocess the text of social dynamics to obtain a preprocessed data set;

[0037] A semantic graph construction module, configured to construct a semantic graph including word nodes and social dynamic nodes according to the data set; wherein the word nodes are connected based on a word co-occurrence mechanism, and the social dynamic nodes are connected based on the word nodes;

[0038] A multi-layer graph construction module is used to extract the association information between the social dynamics according to the topic attributes of the social dynamics and the user relationships between the users who posted the social dynamics, and to establish the connection relationship between the nodes of the social dynamics according to the association information between the social dynamics, so as to obtain a social dynamics multi-layer graph including semantic relationships and social relationships;

[0039] The sentiment analysis module is used to input the multi-layer graph of social dynamics into an integrated model for processing to obtain the sentiment classification result of the social dynamics; wherein the integrated model is composed of a graph convolutional neural network based on hyperbolic learning and a large-scale pre-trained language model.

[0040] In a third aspect, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method described in the first aspect when executing the computer program.

[0041] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0042] The above-mentioned sentiment classification method, system, device and storage medium for network social dynamics, on the one hand, introduces super-language information such as social environment factors to construct a social dynamics multi-layer graph containing semantic and social environment factors and the interactions between them, which can more accurately represent the sentiment of social dynamics. On the other hand, by forming an integrated model based on a graph convolutional neural network based on hyperbolic learning and a large-scale pre-trained language model, the interaction between social and semantic information and the scale-free distribution characteristics of social factors can be modeled. Therefore, the accuracy of sentiment classification of social dynamics can be improved by inputting the social dynamics multi-layer graph into the integrated model for processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A hardware structure block diagram of a terminal of a method for classifying sentiments of network social dynamics in one embodiment;

[0044] Figure 2 A flowchart of a method for classifying sentiment of network social dynamics in one embodiment;

[0045] Figure 3 is a flowchart of a method for constructing a semantic graph in one embodiment;

[0046] Figure 4 A flowchart of a multi-layer graph construction method in one embodiment;

[0047] Figure 5 A flowchart of a multi-layer graph construction method in one embodiment;

[0048] Figure 6 A structural block diagram of a network social dynamics sentiment classification system in one embodiment;

[0049] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0051] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with general skills in the technical field to which this application belongs. The words "one", "a", "the", "these" and the like in this application do not indicate a quantitative limitation, and they may be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone. Generally, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0052] Social environment plays an important role in the development and evolution of human language. By considering this factor, we can have a better understanding of language information. Although social environment factors can be modeled into sentiment analysis systems using graph neural networks, simply connecting social environment factors with text context in Euclidean space still fails to capture the interaction between social and semantic information and the scale-free distribution characteristics of social factors.

[0053] In order to address these limitations, the present application provides a sentiment classification method for network social dynamics, aiming to improve the accuracy of sentiment classification of social dynamics.

[0054] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 1 is a hardware structure block diagram of a terminal of a method for classifying sentiments of network social dynamics according to an embodiment of the present application. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 101 and memory 102 for storing data, wherein processor 101 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 103 and an input and output device 104 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0055] The memory 102 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the emotional classification method of network social dynamics in the present embodiment. The processor 101 executes various functional applications and data processing by running the computer program stored in the memory 102, that is, to implement the above method. The memory 102 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 102 may further include a memory remotely arranged relative to the processor 101, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0056] The transmission device 103 is used to receive or send data via a network. The above network includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device 103 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 103 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0057] In one embodiment, Figure 2 As shown in the figure, a sentiment classification method for network social dynamics is provided. Figure 1The terminal in is used as an example to illustrate, including the following steps:

[0058] Step S1, preprocessing the text of social dynamics to obtain a preprocessed data set.

[0059] Social dynamics refers to the content and activities posted by users on social media platforms, which can include text messages, links, comments, replies, emoticons, forwarding, sharing, etc. Regular expressions can be used to extract emotional symbols, topic tags (#hashtag), mentions and other expressions in the text to generate data that can be processed by neural networks.

[0060] Step S2, constructing a semantic graph including word nodes and social dynamic nodes based on the data set; wherein, a connection relationship is established between word nodes based on a word co-occurrence mechanism, and a connection relationship is established between social dynamic nodes based on word nodes.

[0061] This step takes into account both local semantic information and global semantic information. The connection between word nodes and social dynamic nodes provides local semantic context information, and the connection between social dynamic nodes through word nodes provides global semantic context information. The word co-occurrence mechanism refers to the statistical phenomenon of two or more words appearing at the same time. Specifically, if two words often appear in the same context, then there is a certain correlation or co-occurrence relationship between them.

[0062] Step S3, extracting the correlation information between social dynamics according to the topic attributes of the social dynamics and the relationships between users who publish the social dynamics, and establishing the connection relationship between the social dynamics nodes according to the correlation information between the social dynamics, to obtain a multi-layer graph of social dynamics including semantic relationships and social relationships.

[0063] The correlation information between social dynamics follows the emotional consistency theory and emotional contagion theory in sociology, so that the social dynamics multi-layer graph fully considers the impact of social network environmental factors on text sentiment analysis, which is conducive to improving the accuracy of text sentiment recognition.

[0064] Step S4, inputting the multi-layer graph of social dynamics into the integrated model for processing to obtain the sentiment classification result of the social dynamics; wherein the integrated model is composed of a graph convolutional neural network based on hyperbolic learning and a large-scale pre-trained language model.

[0065] The large-scale pre-trained language model (Bidirectional Encoder Representations from Transformers), referred to as BERT, can capture contextual information through unsupervised learning based on a large amount of text data in advance, and is used for natural language processing tasks. It can simultaneously consider the contextual information on both sides of a word through a bidirectional encoding mechanism, thereby generating more accurate word representations. The hyperbolic graph convolutional neural network (HGCN) based on hyperbolic learning can mine deep information in multi-layer graphs of social dynamics, improve the ability to represent and classify text, and ultimately improve the accuracy of sentiment classification of social dynamics.

[0066] In the above steps S1 to S4, on the one hand, by introducing super-language information such as social environment factors, a multi-layer graph of social dynamics including semantic and social environment factors and the interactions between them is constructed, which can more accurately represent the emotions of social dynamics. On the other hand, by constructing an integrated model based on a graph convolutional neural network based on hyperbolic learning and a large-scale pre-trained language model, the interaction between social and semantic information and the scale-free distribution characteristics of social factors can be modeled. Therefore, inputting the multi-layer graph of social dynamics into the integrated model for processing can improve the accuracy of emotional classification of social dynamics.

[0067] In one embodiment, the above step S2 may be performed by Figure 3 The method shown is implemented. Figure 3 A semantic graph construction method is provided, such as Figure 3 As shown in the figure, a semantic graph containing word nodes and social dynamic nodes is constructed based on the data set, including the following steps:

[0068] Step S21, using a window with a preset step size to cut sentences in the text, and counting the frequency of a single word appearing in the window and the frequency of two words co-occurring.

[0069] Use a window of length L to cut the sentence into small segments, and count the frequency of a single word in the window and the frequency of two words co-occurring. The frequency calculation formula for a single word is p(i)=count(i) / #W, and the frequency calculation formula for two words co-occurring is p(i,j)=count(i,j) / #W, where count() is the number of times the word appears, #W represents the number of windows, and i and j represent two words respectively.

[0070] Step S22, calculating the connection weights between word nodes based on the frequency of a single word appearing in the window and the frequency of two words co-occurring.

[0071]

[0072] Among them, PMI (i, j) represents the connection weight between word nodes i and j.

[0073] Step S23, calculate the connection weight between the social dynamic node and the word node based on the TF-IDF information of the single word. The calculation formula is as follows:

[0074]

[0075] The meanings of the symbols are as follows:

[0076] TF-IDF(): the connection weight between social dynamic nodes and word nodes;

[0077] TF(d,w): word frequency, the frequency of word w appearing in text d;

[0078] IDF(w): Inverse document frequency, used to measure whether a word is common;

[0079] : multiplication operator;

[0080] d: text;

[0081] w: word;

[0082] N: total number of texts.

[0083] In one embodiment, the above step S3 may be performed by Figure 4 The method shown is implemented. Figure 4 A multi-layer graph construction method is provided, such as Figure 4 As shown, according to the topic attributes of social dynamics and the relationship between users who publish social dynamics, extracting the correlation information between social dynamics includes the following steps:

[0084] Step S31, determining whether the first social dynamics and the second social dynamics are posted by the same user on the same topic; if the first social dynamics and the second social dynamics are posted by the same user on the same topic, confirming that the sentiment tags of the first social dynamics and the second social dynamics are consistent.

[0085] According to the theory of emotional consistency in sociology, if two social dynamics are posted by the same user on the same topic, the emotional labels of the two social dynamics are more likely to be consistent. Assuming that the user social relationship matrix is ​​U, the social dynamic relationship matrix is ​​obtained from the emotional consistency theory If and only if the i-th text and the j-th text are published by the same user. Where T represents the transpose of the matrix.

[0086] Step S32, determining whether the first social dynamics and the second social dynamics are posted by similar users on the same topic; if the first social dynamics and the second social dynamics are posted by similar users on the same topic, confirming that the sentiment tags of the first social dynamics and the second social dynamics are consistent.

[0087] According to the theory of emotional contagion in sociology, if two social dynamics are posted by similar users on the same topic, then the emotional labels of the two social dynamics are more likely to be consistent. Assuming that the user social relationship matrix is ​​U and the user relationship matrix is ​​F, the social dynamic relationship matrix C is obtained from the emotional consistency theory ec =U T FU, If and only if the i-th text and the j-th text are published by the same user. Where T represents the transpose of the matrix.

[0088] Step S33, establishing a connection relationship between the first social dynamic node and the second social dynamic node to obtain a social dynamic relationship matrix; wherein the first social dynamic node corresponds to the first social dynamic, and the second social dynamic node corresponds to the second social dynamic.

[0089] The final social dynamic relationship matrix is ​​calculated based on the theory of emotional consistency and emotional contagion, that is, C = C ec +C SC .

[0090] In one embodiment, the above step S4 may be performed by Figure 5 The method shown is implemented. Figure 5 A multi-layer graph construction method is provided, such as Figure 5 As shown in FIG. 1 , the social dynamic multi-layer graph is input into the integrated model for processing, including the following steps:

[0091] Step S41, generating a multi-dimensional vector according to a large-scale pre-trained language model to initialize social dynamic nodes in a social dynamic multi-layer graph.

[0092] BERT is used to generate a 768-dimensional vector (corresponding to [CLS]) to initialize the microblog nodes in the multi-layer graph. [CLS] represents the CLS (classification) vector output by the hidden layer in BERT, which represents the semantic feature vector of the entire text.

[0093] Step S42, initializing word nodes in the social dynamic multi-layer graph based on zero vectors.

[0094] Step S43: Mapping the feature vectors of the social dynamic nodes and word nodes from the Euclidean space to a hyperbolic space with multiple curvatures.

[0095] The feature vector x of the node 0,E ∈R dMapping from Euclidean space to hyperbolic space H d,k , K represents the curvature of the hyperbolic space, Represents the origin of the hyperbolic space. The mapping calculation formula is as follows:

[0096]

[0097] The meanings of the symbols are as follows:

[0098] H: hyperbolic space;

[0099] E: European space;

[0100] x 0,E : source point in Euclidean space;

[0101] x 0,H : target point in hyperbolic space;

[0102] : Exponential mapping function in hyperbolic space, used to move a specified length along a given direction starting from the origin of the hyperbolic space;

[0103] (0, x 0,E ): This tuple represents starting from the origin of the hyperbolic space and following x 0,E The distance moved in the direction is ||x 0,E || 2 (i.e. x 0,E Euclidean norm of );

[0104] cosh(): hyperbolic cosine function;

[0105] cinh(): hyperbolic sine function;

[0106] ||x 0,E || 2 : Point x 0,E The second norm in Euclidean space (i.e., Euclidean distance).

[0107] Step S44, stacking multiple layers of graph convolution, converting and aggregating the embedded representations of the neighbor nodes of the central node in the tangent space of each layer of graph convolution, and mapping the processing results to the hyperbolic space.

[0108] The hyperbolic feature conversion formula for each layer of graph convolution is as follows:

[0109]

[0110] The meanings of the symbols are as follows:

[0111] W l : weight matrix;

[0112] b l: bias vector;

[0113] : Multiplication operations in hyperbolic space;

[0114] : Addition operation in hyperbolic space;

[0115] x H : a point in hyperbolic space;

[0116] l: graph convolution layer;

[0117] h l,H : The hidden state of the l-th layer node in the hyperbolic space;

[0118] x l-1,H : Representation of l-1 layer nodes in hyperbolic space;

[0119] : Logarithmic mapping operator in hyperbolic space;

[0120] : Projection operation, projecting the bias vector into the hyperbolic space;

[0121] : Exponential mapping function in hyperbolic space, used to map the projected bias vector into the hyperbolic space.

[0122] Step S45, perform neighbor aggregation processing on the neighbor nodes of the central node based on the attention mechanism. The calculation formula is as follows:

[0123]

[0124] The meanings of the symbols are as follows:

[0125] N(i): the set of neighbor nodes of node i;

[0126] m H : Aggregation result, which represents the aggregation information of nodes in the hyperbolic space;

[0127] Agg(): Aggregation function, used to summarize the information of neighbor nodes;

[0128] w ij : The attention weight between node x and its neighbor node j;

[0129] : For each neighbor node j of node x, calculate the vector from node x to neighbor node j, and then use weight w ij Weighted sum;

[0130] : A logarithmic mapping function in a hyperbolic space, used to convert the representation of a node x in a hyperbolic space into a vector starting from the node x;

[0131] Softmax: normalization function;

[0132] max j∈N(i) :Calculate the maximum value in the neighbor node set N(i) of node i;

[0133] MLP: Multi-Layer Perceptron, a feed-forward neural network used to extract features and calculate attention scores;

[0134] : The representation of node i and node j in hyperbolic space;

[0135] ||: Vector concatenation operation, connects two vectors together.

[0136] Step S46, calculate the nonlinear activation value in the graph convolutional neural network according to the hyperbolic curvature of different graph convolutional layers in the hyperbolic space. The calculation formula is as follows:

[0137]

[0138] Among them, different K represents the hyperbolic curvature of different graph convolutional layers. The meanings of each symbol are as follows:

[0139] x l,H : The representation of the l-layer nodes in the hyperbolic space;

[0140] σ: activation function in hyperbolic space, used to introduce nonlinear characteristics;

[0141] K l , K l-1 : The curvature constant of the hyperbolic space of the current layer of graph convolution and the previous layer of graph convolution;

[0142] m l,H : The intermediate state of the l-th layer nodes in the hyperbolic space.

[0143] In one embodiment, after calculating the nonlinear activation value in the graph convolutional neural network according to the hyperbolic curvature of different graph convolutional layers in the hyperbolic space, the method further includes:

[0144] The predicted values ​​output by the graph convolutional neural network and the large-scale pre-trained language model are weighted according to the preset output weights to obtain the predicted values; the sentiment classification results of the text are obtained based on the predicted values.

[0145] In this embodiment, in order to solve the over-smoothing problem of the graph convolutional neural network, a linear interpolation method is introduced to calculate the final output of the model. The calculation formula is as follows:

[0146]

[0147] Among them, output HGCN and output BERT They represent the output of the softmax layer in HGCN and BERT respectively, and λ represents the preset output weight, which is used to control the output of the model.

[0148] Furthermore, the cross entropy loss between the predicted value and the true label is calculated; the model parameters of the integrated model are adjusted according to the cross entropy loss. This step updates the model weights through back propagation to minimize the loss function, thereby improving the prediction accuracy of the model.

[0149] Based on the same inventive concept as the above-mentioned method for classifying emotions of network social dynamics, in one embodiment, a system for classifying emotions of network social dynamics is provided. Figure 6 is a structural diagram of the network social dynamics sentiment classification system in this embodiment, such as Figure 6 As shown, the system includes:

[0150] A text preprocessing module is used to preprocess the text of social dynamics to obtain a preprocessed data set;

[0151] A semantic graph construction module is used to construct a semantic graph including word nodes and social dynamic nodes according to the data set; wherein the word nodes are connected based on the word co-occurrence mechanism, and the social dynamic nodes are connected based on the word nodes;

[0152] A multi-layer graph construction module is used to extract the correlation information between social dynamics according to the topic attributes of the social dynamics and the relationships between users who publish the social dynamics, and to establish the connection relationship between the nodes of the social dynamics according to the correlation information between the social dynamics, so as to obtain a multi-layer graph of social dynamics containing semantic relationships and social relationships;

[0153] The sentiment analysis module is used to input the multi-layer graph of social dynamics into the integrated model for processing to obtain the sentiment classification results of social dynamics; wherein, the integrated model is composed of a graph convolutional neural network based on hyperbolic learning and a large-scale pre-trained language model.

[0154] In this embodiment, on the one hand, by introducing super-language information such as social environment factors, a multi-layer graph of social dynamics including semantic and social environment factors and the interactions between them is constructed, which can more accurately represent the emotions of social dynamics. On the other hand, by constructing an integrated model based on a graph convolutional neural network based on hyperbolic learning and a large-scale pre-trained language model, the interaction between social and semantic information and the scale-free distribution characteristics of social factors can be modeled. Therefore, the accuracy of sentiment classification of social dynamics can be improved by inputting the multi-layer graph of social dynamics into the integrated model for processing.

[0155] The specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, which will not be repeated in this embodiment. It should be noted that the above modules can be functional modules or program modules, which can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

[0156] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for classifying emotions of network social dynamics is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0157] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0158] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above method embodiments are implemented.

[0159] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0160] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0161] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0162] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A sentiment classification method for network social dynamics, characterized in that: include: Preprocess the text of social dynamics to obtain a preprocessed data set; Constructing a semantic graph including word nodes and social dynamic nodes according to the data set; wherein the word nodes are connected based on a word co-occurrence mechanism, and the social dynamic nodes are connected based on the word nodes; Extracting association information between the social dynamics according to topic attributes of the social dynamics and relationships between users who publish the social dynamics, and establishing connection relationships between the social dynamics nodes according to the association information between the social dynamics, to obtain a social dynamics multi-layer graph including semantic relationships and social relationships; The social dynamics multi-layer graph is input into an integrated model for processing to obtain a sentiment classification result of the social dynamics; wherein the integrated model is composed of a graph convolutional neural network based on hyperbolic learning and a large-scale pre-trained language model.

2. The method for classifying sentiment of network social dynamics according to claim 1, characterized in that: A semantic graph including word nodes and social dynamic nodes is constructed according to the data set, including: Using a window with a preset step length to cut sentences in the text, and counting the frequency of a single word appearing in the window and the frequency of two words co-occurring; Calculate the connection weight between the word nodes according to the frequency of occurrence of the single word in the window and the frequency of co-occurrence of two words; The connection weight between the social dynamic node and the word node is calculated according to the TF-IDF information of the single word.

3. The method for classifying sentiment of network social dynamics according to claim 1, characterized in that: Extracting association information between the social dynamics according to the topic attributes of the social dynamics and the relationship between users who posted the social dynamics includes: Determining whether the first social dynamic and the second social dynamic are posted by the same user on the same topic; If the first social dynamic and the second social dynamic are posted by the same user on the same topic, confirming that the sentiment labels of the first social dynamic and the second social dynamic are consistent; and / or, Determining whether the first social dynamic and the second social dynamic are posted by similar users on the same topic; If the first social dynamics and the second social dynamics are posted by similar users on the same topic, it is confirmed that the sentiment labels of the first social dynamics and the second social dynamics are consistent.

4. The method for classifying sentiment of network social dynamics according to claim 3, characterized in that: After confirming that the emotion labels of the first social dynamics and the second social dynamics are consistent, the method further includes: A connection relationship between a first social dynamic node and a second social dynamic node is established to obtain a social dynamic relationship matrix; wherein the first social dynamic node corresponds to the first social dynamic, and the second social dynamic node corresponds to the second social dynamic.

5. The method for classifying sentiment of network social dynamics according to claim 1, characterized in that: Inputting the social dynamic multi-layer graph into an integrated model for processing includes: generating a multi-dimensional vector according to the large-scale pre-trained language model to initialize social dynamic nodes in the social dynamic multi-layer graph; Initializing word nodes in the social dynamics multi-layer graph based on zero vectors; Mapping the feature vectors of the social dynamic node and the word node from the Euclidean space to a hyperbolic space with multiple curvatures; Stacking multiple layers of graph convolution, converting and aggregating the embedded representations of the neighboring nodes of the central node in the tangent space of each layer of graph convolution, and mapping the processing results to the hyperbolic space; Performing neighbor aggregation processing on neighbor nodes of the central node based on the attention mechanism; According to the hyperbolic curvatures of different graph convolutional layers in the hyperbolic space, nonlinear activation values ​​in the graph convolutional neural network are calculated.

6. The method for classifying sentiment of network social dynamics according to claim 5, characterized in that: After calculating the nonlinear activation value in the graph convolutional neural network according to the hyperbolic curvatures of different graph convolutional layers in the hyperbolic space, the method further includes: Weighting the predicted values ​​output by the graph convolutional neural network and the large-scale pre-trained language model according to preset output weights to obtain a predicted value; A sentiment classification result of the text is obtained based on the prediction value.

7. The method for classifying sentiment of network social dynamics according to claim 6, characterized in that: After obtaining the sentiment classification result of the text based on the prediction value, the method further includes: Calculate the cross entropy loss between the predicted value and the true label; Model parameters of the ensemble model are adjusted according to the cross entropy loss.

8. A sentiment classification system for network social dynamics, characterized in that: include: A text preprocessing module is used to preprocess the text of social dynamics to obtain a preprocessed data set; A semantic graph construction module, configured to construct a semantic graph including word nodes and social dynamic nodes according to the data set; wherein the word nodes are connected based on a word co-occurrence mechanism, and the social dynamic nodes are connected based on the word nodes; A multi-layer graph construction module is used to extract the association information between the social dynamics according to the topic attributes of the social dynamics and the user relationships between the users who posted the social dynamics, and to establish the connection relationship between the nodes of the social dynamics according to the association information between the social dynamics, so as to obtain a social dynamics multi-layer graph including semantic relationships and social relationships; The sentiment analysis module is used to input the multi-layer graph of social dynamics into an integrated model for processing to obtain the sentiment classification result of the social dynamics; wherein the integrated model is composed of a graph convolutional neural network based on hyperbolic learning and a large-scale pre-trained language model.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

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

Citation Information

Patent Citations

  • Crowd danger degree analysis method under graph convolutional neural network

    CN112365139A

  • Social data analysis method and system and storage medium

    CN113052712A