Social network user viewpoint classification method and device, computing equipment and storage medium
By adopting a method based on large language model in social networks, using structured and unstructured data to construct edge text graphs, reasoning text themes and semantic embeddings, combining feature engineering and dynamic graph attention networks, the problem of inaccurate view analysis in the existing technology is solved, and a higher accuracy of user view classification is achieved.
Patent Information
- Application Number
- CN202510033542.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-05-16
AI Technical Summary
The prior art fails to fully utilize unstructured data and complex interactive relationships in the analysis of social network user perspectives, resulting in inaccurate judgment of views.
Using a method based on a large language model, we construct the social network edge text graph structure by obtaining structured and unstructured data of the social network, using the large language model to reason about text themes and semantic embeddings, and combining feature engineering and dynamic graph attention network for user opinion classification.
By utilizing unstructured data and large language models, the semantic relationships of user posting texts can be captured more accurately and the accuracy of user opinion classification can be improved.
Smart Images

Figure CN120011563A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data analysis technology, and in particular to a method, device, computing equipment and storage medium for classifying social network user opinions based on a large language model. Background Art
[0002] With the rapid development and popularization of the Internet, online social networks have become an important platform for people to share, disseminate and obtain information. Users express their opinions on social networks, and their opinions can be reflected through posting texts, interactive behaviors, personal descriptions, etc. Accurate opinion analysis of social networks is of great significance in the fields of market research, information dissemination control, etc.
[0003] The existing technology for analyzing the opinions of social network users mainly focuses on the field of natural language processing. By segmenting and polarity-labeling the text posted by users, sentiment dictionaries, machine learning, deep learning and other methods are used to analyze the opinions contained in a text. Existing methods do not consider the complex interactive relationships of social networks, and do not make full use of unstructured text information such as user personal descriptions; moreover, sentiment dictionaries, machine learning, and deep learning methods cannot understand complex semantic relationships, so they cannot or cannot correctly embed text, resulting in inaccurate opinion judgments. Summary of the invention
[0004] In view of the above problems, the present invention is proposed to provide a method for classifying social network user opinions based on a large language model to overcome the above problems or at least partially solve the above problems, which includes:
[0005] Step S101: Acquire social network data, including structured data and unstructured data; the unstructured data includes user personal description text, user interaction text and user interaction relationship;
[0006] Step S102: Based on the acquired social network data, users are taken as nodes, and edges between nodes are constructed based on user interaction relationships. Structured data and user personal description texts are taken as node attributes, and user interaction texts are taken as edge attributes to construct a social network edge text graph structure.
[0007] Step S103: using the first language model to infer the text topic of the entire network according to the text attributes on the edges of the social network edge text graph structure;
[0008] Step S104: according to the text theme of the entire network, combined with the text attributes of the nodes and the text attributes of the edges related to the nodes, a second language model is used to obtain a node semantic vector;
[0009] Step S105: extracting the user's structured data into a node feature vector based on feature engineering, and concatenating it with the node semantic vector to obtain a node representation vector;
[0010] Step S106: Input the node representation vector into the graph attention network to classify user opinions.
[0011] Optionally, in step S101, the structured data includes the user's registered gender, registered address, number of likes, and number of followers.
[0012] Optionally, step S103 includes: utilizing the understanding and reasoning capabilities of the large language model, constructing a prompt word with the text attributes on the edge and inputting it into the first large language model, so that the first large language model can infer the text theme of the entire network. And constantly update and maintain this text theme during the input process.
[0013] Optionally, step S104 includes: for each node, using the understanding and reasoning capabilities of the second largest language model, based on the obtained text topic The text attributes of the node itself and the text attributes of the node-related edges are used to construct prompt words, which are input into the second largest language model, so that the second largest language model can infer the node semantic vector t to achieve complex semantic embedding.
[0014] Preferably, the step S105 comprises: mapping the user's structured data to the same scale based on feature engineering, and then splicing the data into a node feature vector s;
[0015] Concatenate the node feature vector s with the node semantic vector t to obtain the node representation vector h:
[0016] h i =s i ||t i
[0017] Among them, h i is the representation vector of node i, s i is the node feature vector of node i, t i represents the semantic vector of node i, and ∥ represents the vector concatenation operation.
[0018] Preferably, the step S106 uses a dynamic graph attention network for classification. When calculating attention, the dynamic graph attention network modifies the order of vector concatenation and linear transformation. ij The calculation is as follows:
[0019] e(h i ,h j )=b T LeakyReLU(W·[h i||h j ])
[0020]
[0021] Among them, h i and h j is the representation vector of user node i, j in the graph neural network, LeakyReLU is the activation function, ∥ represents the vector concatenation operation, and b T , W is the parameter of neural network training and learning, is the set of neighboring nodes of node i, exp is the exponential function; the calculated dynamic attention a ij Represents the attention coefficient of node i to node j.
[0022] Optionally, in the dynamic graph attention network, the update rule of the node representation vector in the dynamic attention network is as follows:
[0023]
[0024] in is the representation vector of node i in the mth layer of the graph neural network, λ is the defined neighborhood weight coefficient, θ is the defined self-weight coefficient, and the representation vector of node i in the m+1th layer of the graph neural network is calculated by the domain node representation vector of the mth layer and the self-representation vector of the mth layer.
[0025] Optionally, the dynamic graph attention network, the loss function of the dynamic graph attention network user opinion classification is set as follows:
[0026]
[0027] Among them, V is the set of all nodes, y is the node's position annotation vector, is the corresponding stance prediction vector, is the cross entropy calculation function.
[0028] According to another aspect of the present invention, a device for classifying social network user opinions based on a large language model is provided, comprising:
[0029] A social network edge text graph construction module is used to obtain social network data, including structured data and unstructured data; the unstructured data includes user personal description text, user interaction text and user interaction relationship; users are used as nodes, and edges between nodes are constructed according to user interaction relationships. Structured data and user personal description text are used as node attributes, and user interaction text is used as edge attributes to construct a social network edge text graph structure;
[0030] The text topic inference module is used to construct the prompt word input into the first language model based on the text attribute on the edge of the social network, so that the large language model can infer the text topic of the entire network. And constantly update and maintain this text theme during the input process Output to the semantic vector calculation module;
[0031] Semantic vector calculation module, used to obtain the text theme The text attributes of the node itself and the text attributes of the edges related to the node are used to construct prompt words, which are input into the second largest language model to obtain the node semantic vector;
[0032] The feature vector calculation module is used to extract the user's structured data into node feature vectors based on feature engineering;
[0033] The dynamic graph attention network module is used to splice the node semantic vector and the node feature vector into a node representation vector, input the node representation vector into the dynamic graph attention network, update the node representation vector according to the rules based on the loss function, and classify the user's opinion according to the final node representation vector.
[0034] Preferably, the dynamic graph attention network module calculates the dynamic attention a ij When , the order of vector concatenation and linear transformation is modified. After modification, the dynamic attention a ij The calculation is as follows:
[0035] e(h i ,h j )=b T LeakyReLU(W·[h i ||h j ])
[0036]
[0037] Among them, h i and h j is the representation vector of user node i, j in the graph neural network, LeakyReLU is the activation function, ∥ represents the vector concatenation operation, and b T , W is the parameter of neural network training and learning, is the set of neighboring nodes of node i, exp is the exponential function; the calculated dynamic attention a ij Represents the attention coefficient of node i to node j.
[0038] According to another aspect of the present invention, there is provided a computing device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;
[0039] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the above-mentioned social network user opinion classification method based on a large language model.
[0040] According to another aspect of the present invention, a computer storage medium is provided, wherein the storage medium stores at least one executable instruction, and the executable instruction enables a processor to perform operations corresponding to the above-mentioned method for classifying social network user opinions based on a large language model.
[0041] Compared with the prior art, the present invention has the following beneficial effects:
[0042] (1) The present invention incorporates unstructured data, including user personal description text and user interaction text. User interaction text and user personal description text provide rich contextual semantic information. Based on these two pieces of information, the semantic embedding vector of the user's posting text can be inferred. If only each text is considered separately, the correct semantic embedding vector cannot be obtained.
[0043] (2) When obtaining semantic embedding vectors based on user interaction texts, the present invention takes into account that user interaction texts only provide local context information about user nodes and cannot obtain context information of user nodes without edges. Therefore, the first language model is used to infer the text topic, thereby obtaining the global context information of the entire network, and then the second language model is used to combine the text attributes of nodes and edges to obtain the node semantic vector, thereby improving the accuracy of classification.
[0044] (3) In a preferred solution, a dynamic graph attention network is used. Based on the traditional graph attention network, the order of vector concatenation and linear transformation is modified to make up for the problem that the attention weights calculated by the graph attention network have the same relative ranking among different nodes but only different absolute values. This can distinguish the attention coefficient rankings of different users and further improve the classification accuracy.
[0045] The present invention facilitates the analysis of the information dissemination environment of social networks, helps platforms to achieve more accurate control of content, and also promotes the development of social media platforms. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0047] Figure 1A flow chart of a method for classifying social network user opinions based on a large language model provided by an embodiment of the present invention is shown;
[0048] Figure 2 A schematic diagram of a large language model topic reasoning and semantic embedding structure provided by an embodiment of the present invention is shown;
[0049] Figure 3 A schematic diagram of the structure of a device for classifying user opinions of social networks based on a large language model provided by an embodiment of the present invention is shown;
[0050] Figure 4 A schematic diagram of the structure of a computing device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0051] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0052] Example 1
[0053] Figure 1 The present invention shows a method for classifying social network user opinions based on a large language model, such as Figure 1 As shown, the method comprises the following steps:
[0054] Step S101: Obtaining social network structured data and unstructured data, including user registration gender, registration address, number of likes, number of followers, user personal description text, user interaction text, and user interaction relationship, etc.
[0055] In this embodiment, a prediction model is used to predict the user opinion category based on the historical content dissemination relationship between users; specifically, social network structured data includes user registered gender, registered address, number of likes, number of followers, etc.; social network unstructured data includes user personal description text, user interaction text and user interaction relationship, etc. Among them, user personal description text refers to the user's personal profile and other descriptive information on the social network, such as "teacher at a certain school, likes traveling, likes cats". User interaction text refers to the text pairs formed by users' text comments and forwarding of other users. For example, user A commented on user B's post x with y, then there is an interactive text xy of user AB. User interaction relationship refers to the interaction between users, such as forwarding, liking, etc. For example, if A likes B, it is necessary to establish an edge from A to B in step S102. If A and B comment on each other, two edges need to be established, namely A to B and B to A.
[0056] Step S102: Based on the acquired social network data, the structured data and the user's personal description text are used as node attributes, and the user interaction text is used as the edge attribute to construct a social network edge text graph structure.
[0057] In this step, based on the acquired social network data, users are taken as nodes, and the edges between nodes are constructed based on the user interaction relationship. The structured data and user personal description text are taken as node attributes, and the user interaction text is taken as the edge attribute to construct the social network edge text graph structure.
[0058] Step S103: Based on the edge text graph structure of the social network and using the reasoning capability of the large language model, the text topics of the entire network are inferred based on the text attributes on the edges.
[0059] Specifically, the understanding and reasoning ability of the Large Language Model (LLM) is used to construct the prompt word with the text attributes on the edge and input it into the first language model, so that the first language model can infer the text theme of the entire network. And constantly update and maintain this text theme during the input process
[0060] Step S104: Based on the text theme of the entire network, combined with the text attributes of the nodes and the text attributes of the related edges, a large language model is used to perform complex semantic embedding to obtain a node semantic vector.
[0061] Specifically, Figure 2 As shown, for each node, the understanding and reasoning ability of the large language model is used to obtain the text topic The text attributes of the node itself and the text attributes of the node-related edges are used to construct prompt words, which are input into the second largest language model to obtain the node semantic vector t to achieve complex semantic embedding.
[0062] Step S105: extract the node feature vector based on feature engineering, and concatenate it with the node semantic vector to obtain the node representation vector.
[0063] Based on feature engineering, the user's structured data values are mapped to the [0,1] interval, so that data values of different ranges are unified to the same scale, and then these values are concatenated into a node feature vector s; the node feature vector s is concatenated with the node semantic vector t to obtain the node representation vector h:
[0064] h i =s i ||t i
[0065] Among them, h i is the representation vector of node i, s iis the feature vector of node i, t i represents the semantic vector of node i, and ∥ represents the vector concatenation operation.
[0066] Step S106: Input the node representation vector into the dynamic graph attention network to classify user opinions.
[0067] Graph Attention Network (GAT) is an advanced Graph Neural Network (GNN) model that enhances the model's ability to capture node-to-node relationships and feature information by introducing an attention mechanism between nodes. GAT introduces learnable attention weights for each edge in the graph. This means that the model can dynamically determine the influence of a node's neighbor nodes on it during information transmission, thereby more flexibly capturing complex relationship patterns between nodes. Through the attention coefficient, GAT assigns a weight to each neighbor node, which reflects how the current node should value the neighbor's information when aggregating neighbor information. This enables the model to adaptively adjust the degree of attention to different neighbors in each propagation step.
[0068] However, although the traditional attention network can distinguish the absolute values of the attention coefficients of different users, it will cause the relative rankings of the attention coefficients of different users to other users to be the same. This is inconsistent with the actual situation of social networks, because the relative rankings of the attention of different users to the attention of domain users are different. Therefore, this embodiment uses a dynamic graph attention network, and on the basis of GAT, modifies the order of vector concatenation and linear transformation, making up for the problem that the attention weights calculated by GAT have the same relative rankings between different nodes but only different absolute values.
[0069] The traditional GAT attention calculation method is as follows:
[0070] e(h i ,h j )=LeakyReLU(b T [Wh i ||Wh j ])
[0071]
[0072] This embodiment of dynamic attention a ij The calculation is as follows:
[0073] e(h i ,h j )=b T LeakyReLU(W·[h i ||h j ])||
[0074]
[0075] Among them, h i and h j is the representation vector of user node i, j in the graph neural network, LeakyReLU is the activation function, ∥ represents the vector concatenation operation, and b T , W is the parameter of neural network training and learning, is the set of neighboring nodes of node i, exp is the exponential function; the calculated dynamic attention a ij Represents the attention coefficient of node i to node j.
[0076] Specifically, the update rules of the node representation vector in the dynamic attention network are as follows:
[0077]
[0078] in, is the representation vector of node i in the mth layer of the graph attention network, λ is the defined neighborhood weight coefficient, θ is the defined self-weight coefficient, and the representation vector of node i in the m+1th layer of the graph attention network is calculated by the domain node representation vector of the mth layer and the self-representation vector of the mth layer.
[0079] Specifically, the loss function of the dynamic graph attention network user opinion classification is set as follows:
[0080]
[0081] Among them, V is the set of all nodes, y is the node's position annotation vector, is the corresponding stance prediction vector, is the cross entropy calculation function.
[0082] The social network user opinion classification method based on the large language model provided in this embodiment can make full use of the structured data and unstructured data related to social network users to capture the semantic relationship between user posting texts; at the same time, the induction and reasoning capabilities of the large language model are fully utilized to perform text topic reasoning, and in-depth node semantic vectors are obtained, which are spliced with the node feature vectors extracted by feature engineering and input into the dynamic attention network for user opinion classification.
[0083] Example 2
[0084] Figure 3 FIG. 2 shows a schematic diagram of a structure of an embodiment of a device for classifying user opinions of a social network based on a large language model according to the present embodiment. Figure 3As shown, the device includes: a social network edge text graph construction module 301, a text topic reasoning module 302, a semantic vector calculation module 303, a feature vector calculation module 304, and a dynamic graph attention network module 305.
[0085] The social network edge text graph construction module 301 is used to obtain social network data, including structured data and unstructured data; the unstructured data includes user personal description text, user interaction text and user interaction relationship; the user is taken as a node, and the edges between nodes are constructed according to the user interaction relationship. The structured data and the user personal description text are taken as node attributes, and the user interaction text is taken as the edge attribute to construct the social network edge text graph structure.
[0086] The text topic inference module 302 is used to construct a prompt word input into the first language model based on the text attribute on the edge of the social network, so that the first language model can infer the text topic of the entire network. And constantly update and maintain this text theme during the input process
[0087] Semantic vector calculation module 303 is used to use the understanding and reasoning ability of the large language model to obtain the text theme The text attributes of the node itself and the text attributes of the edges related to the node are used to construct prompt words, which are input into the second largest language model to obtain the node semantic vector;
[0088] The feature vector calculation module 304 is used to extract the user's structured data into a node feature vector based on feature engineering.
[0089] The dynamic graph attention network module 305 is used to splice the node semantic vector and the node feature vector into a node representation vector, input the node representation vector into the dynamic graph attention network, update the node representation vector according to the rules based on the loss function, and classify the user's opinion according to the final node representation vector.
[0090] Example 3
[0091] An embodiment of the present invention provides a non-volatile computer storage medium, which stores at least one executable instruction. The computer executable instruction can execute a social network user opinion classification method based on a large language model in any of the above method embodiments.
[0092] The executable instructions may be specifically used to cause the processor to perform the following operations:
[0093] Obtain structured and unstructured data from social networks, including user registration gender, registration address, number of likes, number of followers, user personal description text, user interaction text, and user interaction relationships;
[0094] Based on the acquired social network data, the structured data and personal description text are used as node attributes, and the user interaction text is used as the edge attribute to construct the social network edge text graph structure;
[0095] Based on the edge text graph structure of social networks, the reasoning ability of large language models is used to infer the text topics of the entire network based on the text attributes on the edges.
[0096] According to the text theme of the entire network, combined with the text attributes of the nodes and the text attributes of the related edges, a large language model is used to perform complex semantic embedding to obtain the node semantic vector;
[0097] Based on feature engineering, the node feature vector is extracted and concatenated with the node semantic vector to obtain the node representation vector;
[0098] The node representation vector is input into the dynamic graph attention network to classify user opinions.
[0099] Example 4
[0100] Figure 4 The schematic diagram of the structure of the computing device embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the computing device.
[0101] like Figure 4 As shown, the computing device may include:
[0102] Processor, Communications Interface, Memory, and Communications Bus.
[0103] Wherein: the processor, the communication interface, and the memory communicate with each other via a communication bus. The communication interface is used to communicate with other devices such as a client or other server network elements. The processor is used to execute a program, specifically, to execute the relevant steps in the above-mentioned embodiment of a method for classifying user opinions of a social network based on a large language model.
[0104] Specifically, the program may include program codes including computer operation instructions.
[0105] The processor may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the server may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0106] The memory is used to store programs. The memory may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.
[0107] The program can be specifically used to cause the processor to perform the following operations:
[0108] Obtain social network data, including structured and unstructured data, including user registration gender, registration address, number of likes, number of followers, user personal description text, user interaction text, and user interaction relationships;
[0109] Based on the acquired social network data, users are taken as nodes, and the edges between nodes are constructed according to the user interaction relationship. The structured data and personal description text are taken as node attributes, and the user interaction text is taken as the edge attribute to construct the social network edge text graph structure.
[0110] Based on the edge text graph structure of social networks, the reasoning ability of large language models is used to infer the text topics of the entire network based on the text attributes on the edges.
[0111] According to the text theme of the entire network, combined with the text attributes of the nodes and the text attributes of the related edges, a large language model is used to perform complex semantic embedding to obtain the node semantic vector;
[0112] Based on feature engineering, the user's structured data is extracted as a node feature vector, which is concatenated with the node semantic vector to obtain a node representation vector.
[0113] The node representation vector is input into the dynamic graph attention network to classify user opinions.
[0114] The algorithm or display provided herein is not inherently related to any particular computer, virtual system or other equipment. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the embodiment of the present invention is not directed to any specific programming language yet. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description made to specific languages above is for disclosing the best mode of the present invention.
[0115] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0116] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: the claimed invention requires more features than those explicitly recited in each claim. Rather, as reflected in the claims, the inventive aspects lie in less than all the features of the individual embodiments previously disclosed. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0117] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0118] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, any one of the claimed embodiments may be used in any combination.
[0119] The various component embodiments of the present invention can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components according to embodiments of the present invention. The present invention can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0120] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.
Claims
1. A method for classifying user opinions in social networks based on a large language model, characterized in that: include: Step S101: Acquire social network data, including structured data and unstructured data; the unstructured data includes user personal description text, user interaction text and user interaction relationship; Step S102: Based on the acquired social network data, users are taken as nodes, and edges between nodes are constructed based on user interaction relationships. Structured data and user personal description texts are taken as node attributes, and user interaction texts are taken as edge attributes to construct a social network edge text graph structure. Step S103: using the first language model to infer the text topic of the entire network according to the text attributes on the edges of the social network edge text graph structure; Step S104: according to the text theme of the entire network, combined with the text attributes of the nodes and the text attributes of the edges related to the nodes, a second language model is used to obtain a node semantic vector; Step S105: extracting the user's structured data into a node feature vector based on feature engineering, and concatenating it with the node semantic vector to obtain a node representation vector; Step S106: Input the node representation vector into the graph attention network to classify user opinions.
2. The method according to claim 1, characterized in that In step S101, the structured data includes one or more combinations of the user's registered gender, registered address, number of likes, and number of followers.
3. The method according to claim 1, characterized in that The step S103 includes: The text attributes on the edges are used to construct prompt words and input into the first language model, so that the first language model can infer the text theme of the entire network. And constantly update and maintain this text theme during the input process.
4. The method according to claim 1, characterized in that The step S104 includes: For each node, based on the obtained text topic The text attributes of the node itself and the text attributes of the node-related edges are used to construct prompt words, which are input into the second largest language model, so that the second largest language model can infer the node semantic vector t to achieve complex semantic embedding.
5. The method according to claim 1, characterized in that The step S105 comprises: Based on feature engineering, the user's structured data is mapped to the same scale, and then the data is concatenated into a node feature vector s; Concatenate the node feature vector s with the node semantic vector t to obtain the node representation vector h: h i =s i ||t i Among them, h i is the representation vector of node i, s i is the node feature vector of node i, t i represents the semantic vector of node i, and ∥ represents the vector concatenation operation.
6. The method according to claim 1, characterized in that The step S106 uses a dynamic graph attention network for classification. When calculating attention, the dynamic graph attention network modifies the order of vector concatenation and linear transformation. ij The calculation is as follows: e(h i ,h j )=b T LeakyReLU(W·[h i ||h j ]) Among them, h i and h j is the representation vector of user node i, j in the graph neural network, LeakyReLU is the activation function, ∥ represents the vector concatenation operation, and b T , W is the parameter of neural network training and learning, is the set of neighboring nodes of node i, exp is the exponential function; the calculated dynamic attention a ij Represents the attention coefficient of node i to node j.
7. A device for classifying user opinions on a social network based on a large language model, characterized in that: include: A social network edge text graph construction module is used to obtain social network data, including structured data and unstructured data; the unstructured data includes user personal description text, user interaction text and user interaction relationship; users are used as nodes, and edges between nodes are constructed according to user interaction relationships. Structured data and user personal description text are used as node attributes, and user interaction text is used as edge attributes to construct a social network edge text graph structure; The text topic inference module is used to build the first language model based on the text attributes on the edges of the social network edge text graph to infer the text topic of the entire network. And constantly update and maintain this text theme during the input process Semantic vector calculation module, used to obtain the text theme The text attributes of the node itself and the text attributes of the edges related to the node are used to construct prompt words, which are input into the second largest language model to obtain the node semantic vector; The feature vector calculation module is used to extract the user's structured data into node feature vectors based on feature engineering; The dynamic graph attention network module is used to splice the node semantic vector and the node feature vector into a node representation vector, input the node representation vector into the dynamic graph attention network, update the node representation vector according to the rules based on the loss function, and classify the user's opinion according to the final node representation vector.
8. The device according to claim 7, characterized in that The dynamic graph attention network module calculates the dynamic attention a ij When , the order of vector concatenation and linear transformation is modified. After modification, the dynamic attention a ij The calculation is as follows: e(h i ,h j )=b T LeakyReLU(W·[h i ||h j ]) Among them, h i and h j is the representation vector of user node i, j in the graph neural network, LeakyReLU is the activation function, ∥ represents the vector concatenation operation, and b T , W is the parameter of neural network training and learning, is the set of neighboring nodes of node i, exp is the exponential function; the calculated dynamic attention a ij Represents the attention coefficient of node i to node j.
9. A computing device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the social network user opinion classification method based on a large language model as described in any one of claims 1-6.
10. A computer storage medium, characterized in that: The storage medium stores at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the social network user opinion classification method based on a large language model as described in any one of claims 1-6.
Citation Information
Cited By
Power distribution network fault diagnosis method and device based on large model, terminal and medium
CN120337157A