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

WO2026123426A1PCT designated stage Publication Date: 2026-06-18ZHEJIANG LAB

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
ZHEJIANG LAB
Filing Date
2024-12-31
Publication Date
2026-06-18

Smart Images

  • Figure CN2024144330_18062026_PF_FP_ABST
    Figure CN2024144330_18062026_PF_FP_ABST
Patent Text Reader

Abstract

A sentiment classification method and system for social network dynamics, a device, and a storage medium. The method comprises: preprocessing a text of social dynamics to obtain a preprocessed data set; on the basis of the data set, constructing a semantic graph comprising word nodes and social dynamics nodes; extracting associated information between the social dynamics on the basis of topic attributes of the social dynamics in the semantic graph and inter-user relationships of users who publish the social dynamics, and establishing a connection relationship between the social dynamics nodes on the basis of the associated information between the social dynamics, so as to obtain a multi-layer social dynamics graph comprising a semantic relationship and a social relationship; and inputting the multi-layer social dynamics 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 hyperbolic learning-based graph convolutional neural network and a large-scale pre-trained language model.
Need to check novelty before this filing date? Find Prior Art

Description

Methods, systems, devices, and storage media for classifying sentiment in online social dynamics

[0001] Related applications

[0002] This application claims priority to Chinese patent application filed on December 10, 2024, with application number 202411805809.1, entitled "Method, System, Device and Storage Medium for Emotion Classification of Online Social Dynamics", the entire contents of which are incorporated herein by reference. Technical Field

[0003] This application relates to the field of artificial intelligence, and in particular to a method, system, device, and storage medium for classifying emotions in online social dynamics. Background Technology

[0004] With the rapid development of internet technology, user-generated content on social media platforms such as Twitter and Sina Weibo has experienced explosive growth. In-depth mining and analysis of this fragmented content to obtain accurate user sentiment information has become a crucial need, providing a data foundation for important applications such as recommendation systems and public opinion guidance.

[0005] Current sentiment analysis methods for social media feeds mostly focus on the text itself, primarily aiming to improve text representation capabilities and build more effective text analysis models. However, social media feeds are short and noisy, containing a large number of abbreviations, slang, and informal vocabulary, making it difficult for related sentiment analysis methods to fully understand the semantics of the text.

[0006] Currently, no effective solution has been proposed to address the issue of inaccurate sentiment recognition of social dynamics in related technologies. Summary of the Invention

[0007] According to various embodiments of this application, a method, system, device, and storage medium for classifying the emotions of online social dynamics are provided.

[0008] Firstly, this application provides a method for classifying the sentiment of online social dynamics, including:

[0009] The text of social media posts is preprocessed to obtain a preprocessed dataset;

[0010] A semantic graph containing word nodes and social dynamic nodes is constructed based on the dataset; 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.

[0011] Based on the topic attributes of the social dynamics in the semantic graph and the user relationships between the users who posted the social dynamics, the association information between the social dynamics is extracted, and the connection relationship between the social dynamic nodes is established based on the association information between the social dynamics, resulting in a multi-layer graph of social dynamics that includes semantic relationships and social relationships.

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

[0013] In one embodiment, a semantic graph containing word nodes and social dynamic nodes is constructed based on the dataset, including:

[0014] A window with a preset step size is used to segment sentences in the text, and the frequency of a single word appearing in the window and the frequency of two words co-occurring are counted.

[0015] Calculate the connection weight between the word nodes based on the frequency of the single word appearing in the window and the frequency of co-occurrence of two words;

[0016] The connection weight between the social dynamic node and the word node is calculated based on the TF-IDF information of the individual word.

[0017] In one embodiment, based on the topic attributes of the social updates in the semantic graph and the user relationships between the users who posted the social updates, the association information between the social updates is extracted, including:

[0018] Determine whether the first and second social media posts were published by the same user on the same topic;

[0019] If the first social media post and the second social media post are published by the same user on the same topic, then it is confirmed that the sentiment tags of the first social media post and the second social media post tend to be consistent; and / or,

[0020] Determine whether the first and second social media posts were published by similar users on the same topic;

[0021] If the first social post and the second social post are posted by similar users on the same topic, then it is confirmed that the sentiment tags of the first social post and the second social post tend to be consistent.

[0022] In one embodiment, after confirming that the sentiment tags of the first social post and the second social post are similar, the method further includes:

[0023] Establish the connection relationship between the first social dynamic node and the second social dynamic node to obtain the 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.

[0024] In one embodiment, the social dynamics multi-layer graph is input into an ensemble model for processing, including:

[0025] Multidimensional vectors are generated based on the large-scale pre-trained language model to initialize the social dynamic nodes in the social dynamic multilayer graph;

[0026] Initialize the word nodes in the social dynamic multi-layer graph based on the zero vector;

[0027] The feature vectors of the social dynamic nodes and the word nodes are mapped from Euclidean space to hyperbolic space with multiple curvatures;

[0028] Stack multiple graph convolutions, transform and aggregate the embedding representations of the neighboring nodes of the central node in the tangent space of each graph convolution, and map the processing results into the hyperbolic space;

[0029] The neighbor nodes of the central node are aggregated based on the attention mechanism.

[0030] The nonlinear activation values ​​in the graph convolutional neural network are calculated based on the hyperbolic curvature of different graph convolutional layers in the hyperbolic space.

[0031] In one embodiment, after calculating the nonlinear activation values ​​in the graph convolutional neural network based on the hyperbolic curvature of different graph convolutional layers in the hyperbolic space, the method further includes:

[0032] The predicted values ​​output by the graph convolutional neural network and the large-scale pre-trained language model are weighted according to preset output weights to obtain a weighted predicted value.

[0033] The sentiment classification result of the text is obtained based on the weighted prediction value.

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

[0035] Calculate the cross-entropy loss between the weighted predicted value and the true label;

[0036] The model parameters of the ensemble model are adjusted based on the cross-entropy loss.

[0037] Secondly, this application provides an emotion classification system for online social dynamics, including:

[0038] The text preprocessing module is used to preprocess the text of social media posts to obtain a preprocessed dataset.

[0039] A semantic graph construction module is used to construct a semantic graph containing word nodes and social dynamic nodes based on the dataset; 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;

[0040] The multi-layer graph construction module is used to extract the association information between social dynamics based on the topic attributes of the social dynamics in the semantic graph 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 based on the association information between the social dynamics, so as to obtain a multi-layer graph of social dynamics containing semantic relationships and social relationships.

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

[0042] Thirdly, this application provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in the first aspect above.

[0043] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect above.

[0044] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0046] Figure 1 is a hardware structure block diagram of a terminal for a method of classifying emotions in online social dynamics in one embodiment.

[0047] Figure 2 is a flowchart of an embodiment of a method for classifying the sentiment of online social dynamics.

[0048] Figure 3 is a flowchart of a semantic graph construction method in one embodiment.

[0049] Figure 4 is a flowchart of a multi-layer graph construction method in one embodiment.

[0050] Figure 5 is a flowchart of a multi-layer graph construction method in one embodiment.

[0051] Figure 6 is a block diagram of an emotion classification system for online social dynamics in one embodiment.

[0052] Figure 7 is an internal structure diagram of a computer device in one embodiment. Detailed Implementation

[0053] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0054] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning as understood by one of ordinary skill in the art to which this application pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these,” used in this application, do not indicate quantitative limitation and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to such processes, methods, products, or devices. The terms “connected,” “linked,” and “coupled,” used in this application, are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. The term “multiple” used in this application refers to two or more. The "and / or" operator describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: A alone, A and B simultaneously, and B alone. Typically, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," and "third," etc., used in this application are merely for distinguishing similar objects and do not represent a specific ordering of the objects.

[0055] Social context plays a crucial role in the development and evolution of human language, and considering this factor can lead to a better understanding of linguistic information. Although graph neural networks can be used to model social context factors into sentiment analysis systems, simply connecting social context factors to the textual context in Euclidean space still fails to capture the interaction between social and semantic information, as well as the scale-free distribution characteristics of social factors.

[0056] To address these limitations, this application provides a method for sentiment classification of online social dynamics, aiming to improve the accuracy of sentiment classification of social dynamics.

[0057] The method embodiments provided in this example can be executed in a terminal, computer, or similar computing device. For example, when running on a terminal, Figure 1 is a hardware structure block diagram of a terminal for a network social dynamics sentiment classification method according to an embodiment of this application. As shown in Figure 1, the terminal may include one or more (only one is shown in Figure 1) processors 101 and a memory 102 for storing data, wherein the processor 101 may include, but is not limited to, a processing device such as a microprocessor (MCU) or a programmable logic device (FPGA). The terminal may also include a transmission device 103 for communication functions and an input / output device 104. Those skilled in the art will understand that the structure shown in Figure 1 is merely illustrative and does not limit the structure of the terminal. For example, the terminal may include more or fewer components than shown in Figure 1, or have a different configuration than that shown in Figure 1.

[0058] The memory 102 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the emotion classification method for online social dynamics in this embodiment. The processor 101 executes various functional applications and data processing by running the computer programs stored in the memory 102, thereby implementing the above-described method. The memory 102 may include high-speed random access memory and may also include 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 memory remotely located relative to the processor 101, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0059] The transmission device 103 is used to receive or send data via a network. This network includes a wireless network provided by the terminal's communication provider. In one example, the transmission device 103 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 103 can be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0060] In one embodiment, as shown in Figure 2, a sentiment classification method for online social dynamics is provided. Taking the application of this method to the terminal in Figure 1 as an example, the method includes the following steps:

[0061] Step S1: Preprocess the text of the social media posts to obtain the preprocessed dataset.

[0062] Social feeds refer to the content and activities users post on social media platforms, which can include text messages, links, comments, replies, emojis, reposts, and shares. Regular expressions can be used to extract sentiment indicators, hashtags (#hashtags), mentions, and other expressions from the text, generating data that can be processed by neural networks.

[0063] Step S2: Construct a semantic graph containing word nodes and social dynamic nodes based on the dataset; wherein, word nodes are connected based on word co-occurrence mechanism, and social dynamic nodes are connected based on word nodes.

[0064] This step considers both local and global semantic information. The connection between word nodes and social dynamic nodes provides local semantic context, while the connection between social dynamic nodes via word nodes provides global semantic context. Word co-occurrence refers to the statistical phenomenon of two or more words appearing simultaneously. Specifically, if two words frequently appear in the same context, then there is a certain correlation or co-occurrence relationship between them.

[0065] Step S3: Based on the topic attributes of social dynamics in the semantic graph and the relationships between users who post social dynamics, extract the association information between social dynamics, and establish the connection relationship between social dynamic nodes based on the association information between social dynamics to obtain a multi-layer graph of social dynamics that includes semantic relationships and social relationships.

[0066] The interconnected information between social dynamics follows the sociological theories of emotional consistency and emotional contagion, enabling the multi-layer graph of social dynamics to fully consider the impact of social network environment factors on text sentiment analysis, which is conducive to improving the accuracy of text sentiment recognition.

[0067] Step S4: Input the multi-layer graph of social dynamics into the ensemble model for processing to obtain the sentiment classification result of social dynamics; wherein, the ensemble model consists of a graph convolutional neural network based on hyperbolic learning and a large-scale pre-trained language model.

[0068] Bidirectional Encoder Representations from Transformers (BERT) is a large-scale pre-trained language model that captures contextual information through unsupervised learning on a large amount of text data. It is used for natural language processing tasks because it considers the contextual information on both sides of a word simultaneously through a bidirectional encoding mechanism, thus generating more accurate word representations. Hyperbolic Graph Convolutional Networks (HGCN) based on hyperbolic learning can mine deep information in the multi-layered graph of social dynamics, improving text representation and classification capabilities, and ultimately enhancing the accuracy of sentiment classification in social dynamics.

[0069] In steps S1 to S4 above, on the one hand, by introducing hyperlinguistic information such as social environmental factors, a multi-layered social dynamic graph containing semantic and social environmental factors and their interactions is constructed, which can more accurately represent the sentiment of social dynamics. On the other hand, by constructing an ensemble model using 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-layered social dynamic graph into the ensemble model for processing can improve the accuracy of sentiment classification of social dynamics.

[0070] In one embodiment, step S2 above can be implemented using the method shown in Figure 3. Figure 3 provides a semantic graph construction method. As shown in Figure 3, a semantic graph containing word nodes and social dynamic nodes is constructed based on a dataset, including the following steps:

[0071] Step S21: Use a window with a preset step size to segment sentences in the text, and count the frequency of a single word appearing in the window and the frequency of two words co-occurring.

[0072] The sentence is divided into segments using a window of length L. The frequency of a single word appearing in the window and the frequency of two words co-occurring are counted. The formula for calculating the frequency of a single word is p(i) = count(i) / #W, and the formula for calculating the frequency of two words co-occurring is p(i,j) = count(i,j) / #W, where count() is the number of times a word appears, #W represents the number of windows, and i and j represent the two words respectively.

[0073] Step S22: Calculate the connection weight between word nodes based on the frequency of a single word appearing in the window and the frequency of two words co-occurring.

[0074] Wherein, PMI(i,j) represents the connection weight between word nodes i and j.

[0075] Step S23: Calculate the connection weight between social dynamic nodes and word nodes based on the TF-IDF information of individual words. The calculation formula is as follows:

[0076] TF-IDF(w,d) = TF(d,w) * IDF(w)

[0077] The meanings of each symbol are as follows:

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

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

[0080] IDF(w): Inverse Document Frequency, used to measure how common a word is;

[0081] *: Multiplication operator;

[0082] d: text;

[0083] w: word;

[0084] N: Total number of texts.

[0085] In one embodiment, step S3 above can be implemented using the method shown in Figure 4. Figure 4 provides a multi-layer graph construction method. As shown in Figure 4, based on the topic attributes of social dynamics in the semantic graph and the relationships between users who posted social dynamics, the method extracts the association information between social dynamics, including the following steps:

[0086] Step S31: Determine whether the first social post and the second social post were posted by the same user on the same topic; if the first social post and the second social post were posted by the same user on the same topic, then confirm that the sentiment tags of the first social post and the second social post tend to be consistent.

[0087] According to the sociological theory of sentiment consistency, if two social updates are posted by the same user on the same topic, then the sentiment tags of these two social updates tend to be consistent. Assuming the user's social relationship matrix is ​​U, the social update relationship matrix C is obtained from the sentiment consistency theory. SC =U T U, The i-th text and the j-th text are posted by the same user if and only if the i-th text is posted by the same user. Here, T represents the transpose of the matrix.

[0088] Step S32: Determine whether the first social post and the second social post are posted by similar users on the same topic; if the first social post and the second social post are posted by similar users on the same topic, then confirm that the sentiment tags of the first social post and the second social post tend to be consistent.

[0089] According to the sociological theory of emotional contagion, if two social updates are posted by similar users on the same topic, then the sentiment labels of these two social updates tend to be consistent. Assuming the user social relationship matrix is ​​U and the user relationship matrix is ​​F, the social update relationship matrix C is obtained using the emotional consistency theory. ec =U T FU, The i-th text and the j-th text are posted by the same user if and only if the i-th text is posted by the same user. Here, T represents the transpose of the matrix.

[0090] Step S33: Establish the connection relationship between the first social dynamic node and the second social dynamic node to obtain the 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.

[0091] The final social dynamic relationship matrix is ​​calculated based on the theories of affective consistency and emotional contagion, i.e., C = C0. ec +C SC .

[0092] In one embodiment, step S4 above can be implemented using the method shown in Figure 5. Figure 5 provides a multi-layer graph construction method. As shown in Figure 5, the social dynamic multi-layer graph is input into an ensemble model for processing, including the following steps:

[0093] Step S41: Generate multidimensional vectors based on a large-scale pre-trained language model to initialize social dynamic nodes in the social dynamic multilayer graph.

[0094] BERT is used to generate 768-dimensional vectors (corresponding to [CLS]) to initialize the social dynamic nodes in the social dynamic multilayer graph. Here, [CLS] represents the CLS (classification) vector output by the hidden layer in BERT, which represents the semantic feature vector of the entire text.

[0095] Step S42: Initialize word nodes in the social dynamic multi-layer graph based on zero vectors.

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

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

[0098] The meanings of each symbol are as follows:

[0099] H: Hyperbolic space;

[0100] E: European-style space;

[0101] x 0,E The origin point in European-style space;

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

[0103] An exponential mapping function in hyperbolic space is used to move a specified length along a given direction from the origin of hyperbolic space.

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

[0105] cosh(): Hyperbolic cosine function;

[0106] cinh(): Hyperbolic sine function;

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

[0108] Step S44: Stack multiple graph convolutions, transform and aggregate the embedding representations of the neighboring nodes of the central node in the tangent space of each graph convolution, and map the processing results to the hyperbolic space.

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

[0110] The meanings of each symbol are as follows:

[0111] W l Weight matrix;

[0112] b l Bias vector;

[0113] Multiplication operations in hyperbolic space;

[0114] Addition operations in hyperbolic space;

[0115] x H A point in hyperbolic space;

[0116] l: Graph convolutional layer;

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

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

[0119] Logarithmic mapping operator in hyperbolic space;

[0120] The projection operation projects the bias vector onto hyperbolic space;

[0121] The exponential mapping function in hyperbolic space is used to map the projected bias vector to hyperbolic space. Step S45 involves performing neighbor aggregation on the neighbor nodes of the center node based on an attention mechanism. The calculation formula is as follows:

[0122] The meanings of each symbol are as follows:

[0123] N(i): The set of neighboring nodes of node i;

[0124] m H The aggregation result represents the aggregation information of the nodes in hyperbolic space.

[0125] Agg(): An aggregation function used to summarize information about neighboring nodes;

[0126] w ij Attention weights between node x and its neighbor node j;

[0127] For each neighbor node j of node x, compute the vector from node x to neighbor node j, and then use the weight w ij Weighted summation;

[0128] The logarithmic mapping function in hyperbolic space is used to transform the representation of node x in hyperbolic space into a vector originating from node x;

[0129] softmax: normalization function;

[0130] max j∈N(i) : Calculate the maximum value in the set N(i) of neighboring nodes of node i;

[0131] MLP: Multi-Layer Perceptron, a type of feedforward neural network used to extract features and compute attention scores;

[0132] The representations of nodes i and j in hyperbolic space;

[0133] ||: Vector concatenation operation, which joins two vectors together.

[0134] Step S46: Calculate the nonlinear activation values ​​in the graph convolutional neural network based on the hyperbolic curvature of different graph convolutional layers in hyperbolic space. The calculation formula is as follows:

[0135] Here, different values ​​of K represent the hyperbolic curvature of different graph convolutional layers. The meanings of the symbols are as follows:

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

[0137] σ: Activation function in hyperbolic space, used to introduce nonlinear characteristics;

[0138] K l K l-1 The curvature constant of the hyperbolic space of the convolution of the current graph and the convolution of the previous graph;

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

[0140] In one embodiment, after calculating the nonlinear activation values ​​in the graph convolutional neural network based on the hyperbolic curvature of different graph convolutional layers in hyperbolic space, the method further includes:

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

[0142] In this embodiment, to address the oversmoothing problem of graph convolutional neural networks, a linear interpolation method is introduced to calculate the final output of the model. The calculation formula is as follows:

[0143] output = λoutput HGCN +(1-λ)output BERT

[0144] Where, output HGCN and outputBERT λ represents the output of the softmax layer in HGCN and BERT, respectively, and λ represents the preset output weights used to control the model's output.

[0145] Furthermore, the cross-entropy loss between the weighted predicted values ​​and the true labels is calculated; the model parameters of the ensemble model are then adjusted based on the cross-entropy loss. This step updates the model weights through backpropagation to minimize the loss function, thereby improving the model's prediction accuracy.

[0146] Based on the same inventive concept as the aforementioned sentiment classification method for online social dynamics, an embodiment provides a sentiment classification system for online social dynamics. Figure 6 is a structural block diagram of the sentiment classification system for online social dynamics in this embodiment. As shown in Figure 6, the system includes:

[0147] The text preprocessing module is used to preprocess the text of social media posts to obtain a preprocessed dataset.

[0148] The semantic graph construction module is used to construct a semantic graph containing word nodes and social dynamic nodes based on the dataset; word nodes are connected based on word co-occurrence mechanism, and social dynamic nodes are connected based on word nodes.

[0149] The multi-layer graph construction module is used to extract the association information between social dynamics based on the topic attributes of social dynamics in the semantic graph and the user relationships between users who publish social dynamics, and to establish the connection relationship between social dynamic nodes based on the association information between social dynamics, so as to obtain a multi-layer graph of social dynamics containing semantic relationships and social relationships.

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

[0151] In this embodiment, on the one hand, by introducing hyperlinguistic information such as social environmental factors, a multi-layered social dynamic graph containing semantic and social environmental factors and their interactions is constructed, which can more accurately represent the sentiment of social dynamics. On the other hand, by constructing an ensemble model using 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-layered social dynamic graph into the ensemble model for processing can improve the accuracy of sentiment classification of social dynamics.

[0152] Specific examples in this embodiment can be found in the examples described in the above embodiments and optional implementations, and will not be repeated here. It should be noted that each of the above modules can be a functional module or a program module, and can be implemented in software or hardware. For modules implemented in hardware, each of the above modules can reside in the same processor; or each of the above modules can be located in different processors in any combination.

[0153] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in Figure 7. The computer device includes a processor, memory, communication interface, display screen, and input device connected via a system bus. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for wired or wireless communication with external terminals. Wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a method for classifying the emotions of online social dynamics. The display screen of the computer device may be an LCD screen or an e-ink display screen. The input device of the computer device may be a touch layer covering the display screen, or buttons, a trackball, or a touchpad located on the casing of the computer device, or an external keyboard, touchpad, or mouse, etc.

[0154] Those skilled in the art will understand that the structure shown in Figure 7 is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0155] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above method embodiments.

[0156] 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, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0157] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this 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), magnetic 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. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0158] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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.

[0159] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for classifying the sentiment of online social dynamics, characterized in that, include: The text of social media posts is preprocessed to obtain a preprocessed dataset; A semantic graph containing word nodes and social dynamic nodes is constructed based on the dataset; 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. Based on the topic attributes of the social dynamics in the semantic graph and the user relationships between the users who posted the social dynamics, the association information between the social dynamics is extracted, and the connection relationship between the social dynamic nodes is established based on the association information between the social dynamics, resulting in a multi-layer graph of social dynamics that includes semantic relationships and social relationships. The social dynamics multi-layer graph is input into an ensemble model for processing to obtain the sentiment classification result of the social dynamics; wherein, the ensemble model consists of a graph convolutional neural network based on hyperbolic learning and a large-scale pre-trained language model.

2. The sentiment classification method for online social dynamics according to claim 1, wherein, Based on the dataset, a semantic graph containing word nodes and social dynamic nodes is constructed, including: The sentences in the text are segmented using a window with a preset step size, and the frequency of a single word appearing in the window and the frequency of two words co-occurring are counted. Calculate the connection weight between the word nodes based on the frequency of the single word appearing 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 based on the TF-IDF information of the individual word.

3. The sentiment classification method for online social dynamics according to claim 1, wherein, Based on the topic attributes of the social updates in the semantic graph and the user relationships between the users who posted the social updates, the association information between the social updates is extracted, including: Determine whether the first and second social media posts were published by the same user on the same topic; If the first social media post and the second social media post are published by the same user on the same topic, then it is confirmed that the sentiment tags of the first social media post and the second social media post tend to be consistent; and / or, Determine whether the first and second social media posts were published by similar users on the same topic; If the first social post and the second social post are posted by similar users on the same topic, then it is confirmed that the sentiment tags of the first social post and the second social post tend to be consistent.

4. The sentiment classification method for online social dynamics according to claim 3, wherein, After confirming that the sentiment tags of the first social post and the second social post are consistent, the method further includes: Establish the connection relationship between the first social dynamic node and the second social dynamic node to obtain the 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 sentiment classification method for online social dynamics according to claim 1, wherein, The social dynamic multi-layer graph is input into the ensemble model for processing, including: Multidimensional vectors are generated based on the large-scale pre-trained language model to initialize the social dynamic nodes in the social dynamic multilayer graph; Initialize the word nodes in the social dynamic multi-layer graph based on the zero vector; The feature vectors of the social dynamic nodes and the word nodes are mapped from Euclidean space to hyperbolic space with multiple curvatures; Stack multiple graph convolutions, transform and aggregate the embedding representations of the neighboring nodes of the central node in the tangent space of each graph convolution, and map the processing results into the hyperbolic space; The neighbor nodes of the central node are aggregated based on the attention mechanism. The nonlinear activation values ​​in the graph convolutional neural network are calculated based on the hyperbolic curvature of different graph convolutional layers in the hyperbolic space.

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

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

8. A sentiment classification system for online social dynamics, characterized in that, include: The text preprocessing module is used to preprocess the text of social media posts to obtain a preprocessed dataset. A semantic graph construction module is used to construct a semantic graph containing word nodes and social dynamic nodes based on the dataset; 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; The multi-layer graph construction module is used to extract the association information between social dynamics based on the topic attributes of the social dynamics in the semantic graph 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 based on the association information between the social dynamics, so as to obtain a multi-layer graph of social dynamics containing semantic relationships and social relationships. The sentiment analysis module is used to input the multi-layer graph of the social dynamics into the ensemble model for processing to obtain the sentiment classification result of the social dynamics; wherein, the ensemble model consists 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, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

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