Social network opinion leader mining method based on graphsage
By combining the social network opinion leader mining method of GraphSAGE with user influence measurement model, PageRank algorithm and CELF algorithm, and integrating user information and topological structure information, a binary classification model is formed, which solves the problems of waste of computing resources and poor transferability of existing methods and achieves highly accurate opinion leader mining.
Patent Information
- Application Number
- CN202210211544.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-04
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2042-03-04
AI Technical Summary
Existing methods for identifying opinion leaders on social networks suffer from problems such as wasted computing resources, poor portability, failure to consider user topology relationships, and incomplete user information, resulting in insufficient accuracy in data mining.
We adopted GraphSAGE's social network opinion leader mining method, constructed a social network dataset, and used user influence measurement models, PageRank algorithm and CELF algorithm for pre-classification. We then combined GraphSAGE's node binary classification model for training, integrated user information and topology information to form a binary classification model, and transferred it to use in similar networks.
It improves the accuracy of opinion leader mining, reduces the waste of computing resources, enhances the transferability of the model, and naturally combines user information and topological structure information to improve the accuracy of mining results.
Smart Images

Figure CN114579744B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of social networks, and in particular to a social network opinion leader mining method based on GraphSAGE. BACKGROUND
[0002] Under the background of the vigorous development of the self-media, people are active in various social platforms and can freely express their views on the network. They can express their opinions on commercial products, public events and government policies. In the process of message dissemination, people with strong leadership and influence on others' opinions or behaviors are called opinion leaders. Mining opinion leaders in social networks and exerting their influence are of great significance in business, politics and society. Therefore, designing an efficient and accurate opinion leader mining algorithm is one of the research focuses of current social network analysis.
[0003] The opinion leader mining method in the prior art still has many technical defects, common ones are:
[0004] (1) Method based on scoring rules: user information (such as the number of posts, the number of reposts, the number of likes, etc.) in social platforms is used to construct user influence calculation rules, then the influence of each user is calculated and sorted, and the top-ranked is considered as an opinion leader. This method has the following shortcomings: first, since only a few users are opinion leaders, indiscriminate calculation of users in the social network will waste a lot of time and resources; second, different social networks contain different user information, and the rules designed for a social network cannot be migrated to another social network, which has poor migration performance; third, only user information is considered without considering the topological relationship between users; fourth, the scoring rule design is subjective.
[0005] (2) Method based on social network graph: users are regarded as nodes, and the interaction between users (such as likes, comments, and reposts) is regarded as the edge connecting the nodes, and then a social network graph is constructed, and the node importance measure index in the graph is used to mine opinion leaders. The shortcomings of this method are: it only focuses on mining opinion leaders from the topological relationship between users without considering user information.
[0006] (3) Method based on influence propagation model: this method is based on a social network graph, constructs an influence propagation model, simulates the process of message propagation, and uses a series of influence maximization algorithms to find the K nodes with the largest influence range in the network, thereby mining opinion leaders. This method is a dynamic method that simulates information propagation in nodes, which makes the calculation amount increase dramatically with the increase of network size, so it cannot be applied to large networks; at the same time, this method also does not consider the rich user information in social networks.
[0007] Based on this, a social network opinion leader mining method based on GraphSAGE is proposed to solve the problems existing in the above method. SUMMARY
[0008] The purpose of the present application is to provide a social network opinion leader mining method based on GraphSAGE, which can effectively improve the accuracy of opinion leader mining in social networks.
[0009] The present application is implemented as follows:
[0010] In a first aspect, the present application provides a social network opinion leader mining method based on GraphSAGE, which includes the following steps:
[0011] Constructing a social network data set to obtain social network user information;
[0012] Pre-classifying social network users according to social network user information to obtain a pre-classification result;
[0013] Feature extraction is performed on the pre-classification result to obtain feature data, and an initial node feature is set;
[0014] A node binary classification model based on GraphSAGE is trained on the feature data using the initial node feature to obtain a binary classification model;
[0015] The binary classification model is used to classify social network users who have not participated in training as opinion leaders to obtain a mining result of opinion leaders.
[0016] Further, the above-mentioned pre-classification of social network users according to social network user information to obtain a pre-classification result includes: using a user influence measurement model method, a PageRank algorithm and a CELF algorithm to respectively mine their own opinion leader sets, and taking the intersection of the above-mentioned opinion leader sets as the pre-classification result.
[0017] Further, the above-mentioned user influence measurement model method uses user information in the social network to calculate user influence, and the calculation formula of user influence is:
[0018] userInf=α×Activity+β×Transbility+γ×Confidence
[0019] Where userInf is user influence, Activity represents user activity, Translibity represents historical propagation power, Confidence represents user confidence, and alpha, beta and gamma respectively represent the weights of each term in the formula.
[0020] Further, the calculation formula of the PageRank algorithm is as follows:
[0021]
[0022] wherein PR(p i ) represents the PageRank value of node p i , i.e. the importance of the node, N represents the number of nodes in the social network graph, M(p i ) represents the set of all nodes pointing to node p i , L(p j ) represents the number of nodes pointed to by node p j , and d represents a damping coefficient with a value of 0 to 1.
[0023] Further, the CELF algorithm includes the following steps:
[0024] (1) input the social network graph, the seed node set Seeds and the seed number K, when Seeds is an empty set, calculate the marginal influence of all nodes and sort them;
[0025] (2) add the node with the largest marginal influence to Seeds;
[0026] (3) recalculate the marginal benefit of the remaining nodes, and add the node with the largest marginal benefit to Seeds;
[0027] (4) repeat step (3) until all nodes are included in Seeds.
[0028] Further, the binary classification model training includes: using the Relu function as the activation function, using the cross entropy as the loss function, performing binary classification model training on the feature data, and then optimizing the binary classification model according to the training result.
[0029] Further, it also includes: migrating the binary classification model to other social network data sets of the same type to classify opinion leaders, so as to obtain the mining results of opinion leaders of other social network data sets.
[0030] In a second aspect, the present application provides an electronic device, which includes:
[0031] a memory for storing one or more programs;
[0032] a processor;
[0033] When the one or more programs are executed by the processor, the GraphSAGE-based social network opinion leader mining method of any one of the above first aspects is implemented.
[0034] In a third aspect, the present application provides a computer readable storage medium, which, when executed by a processor, implements the GraphSAGE-based social network opinion leader mining method of any one of the above first aspect.
[0035] Compared with the prior art, the present application has at least the following advantages or beneficial effects:
[0036] (1) The present application directly uses the most basic user information as node features, avoiding complex feature engineering;
[0037] (2) The present application utilizes the characteristics of graph neural networks, can fully utilize user information and topological structure information between users, and can naturally combine the two to improve the accuracy of the mining results;
[0038] (3) The model trained by the present application can be conveniently migrated to the same type of network for use, effectively solving the poor migration problem of other models;
[0039] (4) The present application uses the mining results of other methods as a training set, and through training, the model can have the characteristics of the three methods at the same time, further improving the accuracy of the mining results. BRIEF DESCRIPTION OF DRAWINGS
[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor.
[0041] Figure 1 The GraphSAGE-based social network opinion leader mining method steps diagram for the embodiment 1 of the present application;
[0042] Figure 2 The schematic structural block diagram of an electronic device for the embodiment 2 of the present application.
[0043] Icon: 101, memory; 102, processor; 103, communication interface. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical scheme and advantages of the embodiments of the present application more clear, the technical scheme in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0045] Therefore, the following detailed description of embodiments of the application provided in the accompanying drawings is not intended to limit the scope of the application claimed, but merely represents selected embodiments of the application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor are within the scope of protection of the present application.
[0046] It should be noted that similar reference numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
[0047] It should be noted that in this paper, the term "includes" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment. Without more limitations, the elements defined by the statement "include" do not exclude the presence of other identical elements in the process, method, article or equipment including the elements.
[0048] In the description of the present application, it should also be noted that, unless otherwise explicitly specified and limited, the terms "provided", "connected" should be understood broadly, for example, it can be fixedly connected, or it can be detachably connected, or integrally connected; it can be mechanically connected, or it can be electrically connected; it can be directly connected, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For those of ordinary skill in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0049] Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. In the case of no conflict, each of the following embodiments and each feature in the embodiments can be combined with each other.
[0050] Embodiment 1
[0051] Please refer to Figure 1 , Figure 1 The figure shows a step diagram of a social network opinion leader mining method based on GraphSAGE provided by the embodiment 1 of the present application.
[0052] In this embodiment 1, the following will be described with the data of Sina Weibo, a social platform, as an example:
[0053] The present application provides a social network opinion leader mining method based on GraphSAGE, comprising the following steps:
[0054] Construct a social network data set to obtain social network user information;
[0055] pre-classifying the social network users according to the social network user information to obtain a pre-classification result;
[0056] performing feature extraction on the pre-classification result to obtain feature data, and setting initial node features;
[0057] training a GraphSAGE-based node binary classification model on the feature data through the initial node features to obtain a binary classification model;
[0058] classifying opinion leaders from the social network users not participating in the training by using the binary classification model to obtain an opinion leader mining result.
[0059] The initial node features include basic user information, and setting the initial node features mainly involves extracting features from historical microblog data published by each user before training the GraphSAGE-based node binary classification model on the feature data. Assuming that a node is i and a feature vector is X i , the feature vector X i is expressed as:
[0060] X i = [N f ,N p ,N l ,N r ,N c ,N maxl ,N maxr ,N maxc ]
[0061] N f represents the number of fans of the node i, N p represents the number of published microblogs, N l represents the average number of likes of historical microblogs, N r represents the average number of retweets of historical microblogs, N c represents the average number of comments of historical microblogs, N maxl represents the maximum number of likes of historical microblogs, N maxr represents the maximum number of retweets of historical microblogs, and N maxc represents the maximum number of retweets of historical microblogs. The above features reflect the influence of the node to some extent, and can be directly obtained from the microblog data set without constructing complex feature extraction rules, which is more simple and convenient. Only the most basic user information is needed to enable the GNN model to learn the characteristics of other mining methods to mine opinion leaders and have higher accuracy.
[0062] GraphSAGE is a kind of graph neural network (GNN), which is an inductive learning framework for efficiently generating unknown node feature representation on a super large scale graph by using the attribute information of the node, and the core idea is to generate the feature representation of the center node by learning a function for aggregating the representation of the neighbor nodes, instead of learning the embedding of the node itself, and it can be supervised learning or unsupervised learning, and the data set can be conveniently imported, the graph data can be preprocessed and the graph neural network can be built with the help of GNN library.
[0063] The application provides a social network opinion leader mining method based on GraphSAGE, which comprises the following steps: constructing a social network data set, mining the opinion leaders in the social network data set by using an existing opinion leader mining algorithm, pre-classifying, mining the opinion leader sets by using different types of methods respectively, and then taking the intersection of the opinion leader sets as the pre-classification result; extracting features from the pre-classification result to obtain feature data, and labeling the feature data; then sending the labeled data into a GraphSAGE network for semi-supervised learning training, selecting the most basic user information as node features, and then using the characteristics of the GNN that can converge the information of the adjacent nodes to naturally integrate the user information and the topological structure information between the users in the training process to obtain a trained binary classification model (classifier); finally, the binary classification model classifier is used to classify the remaining data to verify the model effect, and the model can also be migrated to other data sets for use.
[0064] As some preferred embodiments, the pre-classification of the social network users according to the social network user information to obtain the pre-classification result comprises: mining the opinion leader sets of the respective methods by using a user influence measurement model method, a PageRank algorithm and a CELF algorithm respectively, and taking the intersection of the opinion leader sets as the pre-classification result.
[0065] Therefore, the opinion leader sets are mined by using three different types of methods respectively, and then the intersection of the opinion leader sets is taken as the pre-classification result, and the mining result of the fusion of other methods is used as the training set, so that the model can have the characteristics of the three methods at the same time through training, and the accuracy of the mining result is improved.
[0066] As some preferred embodiments, the user influence measurement model method calculates the user influence by using the user information in the social network, and the calculation formula of the user influence is as follows:
[0067] userInf=α×Activity+β×Transbility+γ×Confidence
[0068] Wherein, userInf is user influence, Activity represents user activity, Translibity represents historical transmission, Confidence represents user credibility, and a, β, γ respectively represent the weight of each term in the formula.
[0069] It should be noted that the user influence measurement model method adopts an opinion leader mining method based on a scoring rule, fully utilizes the rich user information in the social network to calculate the user influence userInf, and the user activity Activity is determined by the number of original microblogs and the number of forwarded microblogs. The historical transmission Translibity is determined by the number of fans owned by the user, the average number of forwarded microblogs in the history of the user, the number of comments, and the number of likes. The user credibility Confidence is determined by whether the user profile is complete and whether it is authenticated. The weights a, β, γ of each term are determined by the information entropy theory.
[0070] As some preferred embodiments, the calculation formula of PageRank algorithm is:
[0071]
[0072] Wherein, PR(p i ) represents the PageRank value of node p i , i.e. the importance of the node, N represents the number of nodes in the social network graph, M(p i ) represents the set of all nodes pointing to node p i , L(p j ) represents the number of nodes pointed to by node p j , and d represents a damping coefficient with a value of 0 to 1.
[0073] It should be noted that the PageRank algorithm adopts a method based on a social network graph model. The algorithm believes that the importance of a node is determined by the number and importance of adjacent nodes. According to the calculation formula of PageRank algorithm, the importance of each node can be calculated by iteration until it stabilizes. The damping coefficient d is generally set to 0.85.
[0074] As some preferred embodiments, the CELF algorithm includes the following steps:
[0075] (1) Input the social network graph, the seed node set Seeds and the seed number K. When Seeds is an empty set, calculate the marginal influence of all nodes and sort them;
[0076] (2) Add the node with the largest marginal influence to Seeds;
[0077] (3) Recalculating the marginal revenue of the remaining nodes, and adding the node with the largest marginal revenue to Seeds;
[0078] (4) Repeating step (3) until all nodes are included in Seeds.
[0079] Wherein, the "marginal revenue" refers to the difference between the influence ranges of two seed sets before and after a node is added to the seed set Seeds, that is, how much influence range gain the seed can bring.
[0080] It should be noted that the CELF algorithm is a classical algorithm based on the influence propagation model method, which mainly finds a seed node set Seeds containing K nodes from a social network graph to maximize the influence range, and the influence range refers to the number of nodes affected by the node set in the network. The algorithm calculates the input social network graph, seed set Seeds = empty set, seed number K, and can output the seed set Seeds = {K nodes with the largest influence}.
[0081] As some preferred embodiments, the binary classification model training includes: using a Relu function as an activation function, cross-entropy as a loss function, and performing binary classification model training on the feature data, and then optimizing the binary classification model according to the training result.
[0082] Wherein, the Relu function as an activation function is the type of one layer in the neural network, and using the Relu function can make the network introduce sparsity by itself, and greatly improve the training speed.
[0083] As some preferred embodiments, it further includes: migrating the binary classification model to other social network data sets of the same type for opinion leader classification to obtain the opinion leader mining result of the other social network data sets.
[0084] Therefore, the trained binary classification model can be easily migrated to the same type of network for use, and the opinion leader classification is performed on other social network data sets of the same type to obtain the opinion leader mining result of the other social network data sets, effectively solving the poor migration problem of other models.
[0085] Embodiment 2
[0086] Please refer to Figure 2 , Figure 2 A schematic structural block diagram of an electronic device provided by the embodiment of the present application.
[0087] An electronic device includes a memory 101, a processor 102, and a communication interface 103, which are electrically connected to each other directly or indirectly to realize the transmission or interaction of data. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. The memory 101 can be used to store software programs and modules. The processor 102 performs various functional applications and data processing by executing the software programs and modules stored in the memory 101. The communication interface 103 can be used for signaling or data communication with other node devices.
[0088] The memory 101 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.
[0089] The processor 102 can be an integrated circuit chip with signal processing capability. The processor 102 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0090] It can be understood that the structure shown in the figure is only schematic, and the method for mining social network opinion leaders based on GraphSAGE can also include more or fewer components than those shown in the figure, or have a different configuration from that shown in the figure. Each component shown in the figure can be realized by hardware, software or a combination thereof.
[0091] In the embodiments of the present application, it should be understood that the disclosed method and device can also be implemented by other ways. The embodiments described above are only schematic, for example, the flow chart or block diagram in the drawings shows the possible implementation architecture, function and operation of the method and computer program product according to the embodiments of the present application. In this regard, each block in the flow chart or block diagram can represent a module, a segment or a part of code which comprises one or more executable instructions for implementing the specified logic function. It should also be noted that in some alternative implementations, the functions shown in the blocks can occur in a different order from that shown in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, or they can be executed in reverse order according to the functions involved. It should also be noted that each block in the block diagram and / or flow chart, and the combination of blocks in the block diagram and / or flow chart, can be implemented by a dedicated hardware-based system, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0092] It should also be noted that in some alternative implementations, the functions shown in the blocks can occur in a different order from that shown in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, or they can be executed in reverse order according to the functions involved. It should also be noted that each block in the block diagram and / or flow chart, and the combination of blocks in the block diagram and / or flow chart, can be implemented by a dedicated hardware-based system, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0093] In addition, the functional modules in the various embodiments of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0094] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, and the computer software product is stored in a storage medium, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0095] In summary, the social network opinion leader mining method based on GraphSAGE provided by the embodiment of the application mines the opinion leaders in the social network data set through the existing opinion leader mining algorithm, pre-classifies, adopts the existing three different types of methods: user influence measurement model, PageRank algorithm and CELF algorithm to mine the opinion leader set respectively, and then takes the intersection as the pre-classification result, extracts the features of the pre-classification result to obtain the feature data, and labels the feature data; then the labeled data is sent into the GraphSAGE network for semi-supervised learning training, the most basic user information is selected as the node feature, then the characteristics of the GNN that can converge the information of the adjacent nodes are utilized, the user information and the topological structure information between the users are naturally integrated together in the training process, and a trained binary classification model (classifier) is obtained; finally, the binary classification model classifier is used to classify the remaining data to verify the model effect, and the model can also be migrated to other data sets for use.
[0096] The above only describes preferred embodiments of the application and is not intended to limit the application. Those skilled in the art can make various modifications and changes to the application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the application shall be included in the protection scope of the application.
[0097] It is obvious for those skilled in the art that the application is not limited to the details of the above exemplary embodiments, and the application can be implemented in other specific forms without departing from the spirit or essential characteristics of the application. Therefore, the embodiments should be regarded as exemplary and non-limiting, the scope of the application is defined by the appended claims rather than the above description, and all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in the application. Any reference signs in the claims should not be regarded as limiting the claims.
Claims
1. A method for mining social network opinion leaders based on GraphSAGE, characterized in that, The method comprises the following steps: constructing a social network dataset to obtain social network user information; pre-classifying social network users according to the social network user information to obtain a pre-classification result; extracting features from the pre-classification result to obtain feature data and setting initial node features; training a GraphSAGE-based node binary classification model on the feature data through the initial node features to obtain a binary classification model; using the binary classification model to classify opinion leaders among social network users that have not participated in the training to obtain an opinion leader mining result; the pre-classification of the social network users according to the social network user information to obtain the pre-classification result comprises: using a user influence measurement model method, a PageRank algorithm and a CELF algorithm to respectively mine opinion leader sets, and taking the intersection of the opinion leader sets as the pre-classification result; the expression of the feature data is: wherein is a feature vector corresponding to the feature data; is a node i has a number of fans; is a node i has a number of microblogs published; is a node i has an average number of likes of historical microblogs; is a node i has an average number of retweets of historical microblogs; is a node i has an average number of comments of historical microblogs; is a node i has a maximum number of likes of historical microblogs; is a node i has a maximum number of retweets of historical microblogs. 2.The GraphSAGE-based social network opinion leader mining method of claim 1, wherein, the user influence measurement model method calculates user influence using user information in a social network, and the calculation formula of the user influence is: wherein, influence of the user, representing the activity of the user, representing the historical propagation power, representing the credibility of the user, , , represent the weight of each term in the formula, respectively. 3.The GraphSAGE-based social network opinion leader mining method of claim 1, wherein, the calculation formula of the PageRank algorithm is: in, Represents a node The PageRank value, which indicates the importance of a node. This represents the number of nodes in a social network graph. Indicates pointing to a node The set of all nodes, Represents a node The number of nodes it points to. This represents a damping coefficient with a value between 0 and 1. 4.The GraphSAGE-based social network opinion leader mining method of claim 1, wherein, the CELF algorithm comprises the following steps: (1) input a social network graph, a seed node set Seeds and a seed number K, and calculate the marginal influence of all nodes and sort them when Seeds is an empty set; (2) add the node with the largest marginal influence to Seeds; (3) recalculate the marginal benefits of the remaining nodes, and add the node with the largest marginal benefit to Seeds; (4) repeat step (3) until all nodes are included in Seeds. 5.The GraphSAGE-based social network opinion leader mining method of claim 1, wherein, the binary classification model training comprises: using a Relu function as an activation function, cross-entropy as a loss function, training a binary classification model on the feature data, and then optimizing the binary classification model according to the training result. 6.The GraphSAGE-based social network opinion leader mining method of claim 1, wherein, It also comprises: migrating the binary classification model to other social network datasets of the same type to classify opinion leaders, to obtain an opinion leader mining result of the other social network datasets.
7. An electronic device, comprising: It comprises: a memory for storing one or more programs; a processor; when the one or more programs are executed by the processor, the GraphSAGE-based social network opinion leader mining method according to any one of claims 1-6 is implemented.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the GraphSAGE-based social network opinion leader mining method according to any one of claims 1-6.