Data classification method, device, computer equipment and storage medium

By normalizing the connection weight of the graph data and sampling, the problem of inaccurate sampling of neighbor node features is solved, and the accuracy and stability of data classification are improved.

CN113590720BActive Publication Date: 2025-08-29TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110062637.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-18
Publication Date
2025-08-29
Estimated Expiration
2041-01-18

AI Technical Summary

Technical Problem

When the existing data classification method acquires the characteristics of neighbor nodes, the validity of local information cannot be guaranteed during the sampling process, which affects the accuracy of the final classification results.

Method used

By obtaining the edge-connected weights between the central node and the neighbor node in the data to be classified, performing normalization processing, sampling and classification are performed based on the normalized edge-connected weights to ensure the effective utilization of neighbor node feature information.

Benefits of technology

The validity and accuracy of data classification results are improved, the characteristic information of neighbor nodes is effectively utilized, and the stability and efficiency of classification results are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113590720B_ABST
    Figure CN113590720B_ABST
Patent Text Reader

Abstract

The present application relates to the field of artificial intelligence technology, and specifically includes a data classification method, device, computer equipment and storage medium. The method obtains graph data to be classified, determines the edge weights between the central node of the graph data to be classified and the corresponding neighbor nodes; normalizes the edge weights between the central node and the corresponding neighbor nodes in the graph data to be classified, and obtains the normalized edge weights corresponding to each neighbor node in the graph data to be classified; samples the central node in the graph data to be classified according to the normalized edge weights, and obtains the node sampling results; and further classifies the central node according to the node sampling results of the central node, and obtains the node data classification results corresponding to the graph data to be classified. The sampling results obtained in the present application can effectively utilize the feature information in the neighbor nodes to ensure the validity of the obtained classification results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data classification method, apparatus, computer equipment, and storage medium. Background Art

[0002] Graphs are the most direct tool for describing community relationships. They are composed of nodes and edges, where nodes represent objects in a relationship, and edges represent the closeness of the connection between two objects. With the development of artificial intelligence and graph technology, graph-based data classification methods are becoming increasingly widely used. For example, graph convolutional neural networks (GCNs) can be used to classify nodes (i.e., users) in social network graphs.

[0003] However, in current data classification methods, it is generally necessary to sample the features of neighboring nodes corresponding to the central node of the graph data to improve the robustness of the algorithm. However, sampling these features cannot guarantee the validity of the local information of the neighboring nodes obtained by sampling, which affects the accuracy of the final classification results. Summary of the Invention

[0004] Based on this, it is necessary to provide a data classification method, device, computer equipment and storage medium that can more accurately obtain data classification results in response to the above technical problems.

[0005] A data classification method, comprising:

[0006] Obtaining graph data to be classified, and determining edge weights between a central node of the graph data to be classified and corresponding neighbor nodes;

[0007] Normalizing the edge weights between the central node and the corresponding neighbor nodes in the graph data to be classified to obtain the normalized edge weights corresponding to each neighbor node in the graph data to be classified;

[0008] Sampling the central nodes in the graph data to be classified according to the normalized edge weights to obtain node sampling results;

[0009] The central node is classified according to the node sampling result of the central node, and the node data classification result corresponding to the graph data to be classified is obtained.

[0010] A data classification device, comprising:

[0011] A data acquisition module is used to acquire graph data to be classified and determine the edge weights between the central node of the graph data to be classified and the corresponding neighbor nodes;

[0012] A normalization processing module is used to normalize the edge weights between the central node and the corresponding neighbor nodes in the graph data to be classified, and obtain the normalized edge weights corresponding to each neighbor node in the graph data to be classified;

[0013] A node sampling module, configured to sample the central nodes in the graph data to be classified according to the normalized edge weights, and obtain node sampling results;

[0014] The data classification module is used to classify the central node according to the node sampling result of the central node, and obtain the node data classification result corresponding to the graph data to be classified.

[0015] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0016] Obtaining graph data to be classified, and determining edge weights between a central node of the graph data to be classified and corresponding neighbor nodes;

[0017] Normalizing the edge weights between the central node and the corresponding neighbor nodes in the graph data to be classified to obtain the normalized edge weights corresponding to each neighbor node in the graph data to be classified;

[0018] Sampling the central nodes in the graph data to be classified according to the normalized edge weights to obtain node sampling results;

[0019] The central node is classified according to the node sampling result of the central node, and the node data classification result corresponding to the graph data to be classified is obtained.

[0020] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0021] Obtaining graph data to be classified, and determining edge weights between a central node of the graph data to be classified and corresponding neighbor nodes;

[0022] Normalizing the edge weights between the central node and the corresponding neighbor nodes in the graph data to be classified to obtain the normalized edge weights corresponding to each neighbor node in the graph data to be classified;

[0023] Sampling the central nodes in the graph data to be classified according to the normalized edge weights to obtain node sampling results;

[0024] The central node is classified according to the node sampling result of the central node, and the node data classification result corresponding to the graph data to be classified is obtained.

[0025] The above-mentioned data classification method, device, computer equipment and storage medium, during the process of data classification, obtain the graph data to be classified, determine the edge weight between the central node of the graph data to be classified and the corresponding neighbor node; normalize the edge weight between the central node and the corresponding neighbor node in the graph data to be classified, and obtain the normalized edge weight corresponding to each neighbor node in the graph data to be classified; sample the central node in the graph data to be classified according to the normalized edge weight, and obtain the node sampling result; classify the central node according to the node sampling result of the central node, and obtain the node data classification result corresponding to the graph data to be classified. The present application first obtains the normalized edge weight corresponding to each neighbor node in the graph data to be classified, and then samples the central node based on the normalized edge weight, which can effectively utilize the weight data in the graph data to be classified, and the obtained sampling result can effectively utilize the feature information in the neighbor node, thereby ensuring the validity of the obtained classification result. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 A diagram of an application environment of a data classification method in one embodiment;

[0027] Figure 2 1 is a flow chart of a data classification method in one embodiment;

[0028] Figure 3 Schematic diagram of a process for normalizing edge weights in one embodiment;

[0029] Figure 4 Schematic diagram of a process for sampling a central node in one embodiment;

[0030] Figure 5 1. A flowchart illustrating the steps of pruning the classified graph data according to the normalized edge weight ranking in one embodiment;

[0031] Figure 6 Schematic diagram of the node structure before and after pruning in one embodiment;

[0032] Figure 7 A schematic diagram of the steps for updating node information of a sampling node in one embodiment;

[0033] Figure 8 Schematic diagram comparing the node structures of original sampling and pre-aggregation sampling in one embodiment;

[0034] Figure 9 Schematic diagram of a process for aggregating node feature information of sampling neighbor nodes corresponding to a sampling node in one embodiment;

[0035] Figure 10 is a structural block diagram of a data classification device in one embodiment;

[0036] Figure 11 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0038] Artificial Intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also involves studying the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.

[0039] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0040] The solutions provided in the embodiments of the present application involve technologies such as machine learning (ML) of artificial intelligence. Machine learning is a multi-disciplinary subject that involves multiple disciplines such as probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specializes in how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across various fields of artificial intelligence. Machine learning and deep learning generally include technologies such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and formula-based learning. The solutions of the present application are specifically described by the following embodiments:

[0041] The data classification method provided in this application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The terminal 102 can send the graph data to be classified to the server 104, so that the server 104 can classify each node in the graph data to be classified, and perform subsequent processing such as information recommendation based on the classification results. First, the server 104 obtains the graph data to be classified submitted by the terminal 102, determines the edge weight between the central node of the graph data to be classified and the corresponding neighbor node; normalizes the edge weight between the central node and the corresponding neighbor node in the graph data to be classified, and obtains the normalized edge weight corresponding to each neighbor node in the graph data to be classified; samples the central node in the graph data to be classified according to the normalized edge weight to obtain the node sampling result; classifies the central node according to the node sampling result of the central node, and obtains the node data classification result corresponding to the graph data to be classified. In a specific embodiment, the server 104 is equipped with a trained graph convolutional neural network classification model. After obtaining the graph data to be classified, the graph convolutional neural network classification model can be used to perform the above processing on the graph data to be classified to obtain the final node data classification result. The terminal 102 may be, but is not limited to, various personal computers, laptops, smartphones, tablet computers, and portable wearable devices, and the server 104 may be implemented as an independent server or a server cluster consisting of multiple servers. In another embodiment, the data classification method of the present application may also be applied to the terminal, and the user may directly execute the method on the terminal side.

[0042] In one embodiment, Figure 2 As shown, a data classification method is provided, which is applied to Figure 1 Taking the server 104 in the example as an example, the following steps are included:

[0043] Step 201: Obtain graph data to be classified, and determine the edge weights between the central node of the graph data to be classified and the corresponding neighbor nodes.

[0044] Among them, the data classification method of the present application is specifically used to classify each node in the graph data to be classified, and the basis for classification is the connection relationship between the nodes and the characteristics of the nodes. The graph in the graph data to be classified is the most direct tool for describing the community relationship chain. It is composed of nodes and edges. The nodes represent the relationship chain objects, and the edges represent the closeness of the connection between the two objects. When the graph data to be classified is obtained, the edges between the nodes in the structure graph are also accompanied by corresponding edge weight data. The edge weight is used to reflect the closeness of the connection between the two objects represented by the nodes. The central node in the graph is the classification object in the data classification process. During the processing, each node in the graph data to be classified needs to be calculated as a central node, and the neighbor nodes are other nodes directly or indirectly connected to the central node. For different central nodes, the corresponding neighbor nodes are also different. In one embodiment, the present application specifically implements the node data classification in the graph data to be classified through a graph convolutional neural network classification model. Convolutional Neural Networks (CNN) is a type of feedforward neural network (Feedforward Neural Networks) that includes convolution calculations and has a deep structure. It is one of the representative algorithms of deep learning. Convolutional neural networks have the ability to learn representations and can perform translation-invariant classification of input information according to their hierarchical structure. Therefore, they are also called "translation-invariant artificial neural networks." Graph convolutional neural networks use convolution operations on graphs, and the extracted features are also features on the graph. The graph convolutional neural network classification model in this application is specifically a graph convolutional neural network classification model based on the spatial domain.

[0045] Specifically, when the terminal 102 wants the server 104 to classify each node in the graph data, the graph data to be classified can be input into the server 104 as graph data to be classified, and the nodes in the graph data to be classified can be classified by the server 104. The graph data to be classified input to the server 104 contains nodes, edges between nodes, and weight data of the edges. In one embodiment, the server 104 is equipped with a trained graph convolutional neural network classification model. The data classification method of the present application specifically trains the graph convolutional neural network model through semi-supervised training. At this time, the initial graph convolutional neural network model can be trained through the training graph data in the historical data. The training graph data contains some marked nodes. The server 104 starts training these marked nodes as the central nodes of the model training, and determines the edge weights between the central node and the corresponding neighbor nodes based on the input data. In one embodiment, the graph convolutional neural network model of the present application is specifically a GraphSAGE graph convolutional neural network classification model. In this case, the process of determining neighbor nodes can randomly select N (N<< the number of neighbors of each central node) nodes for each central node as sampled neighbor nodes, and determine the edge weights between the central node and the corresponding neighbor nodes based on the input graph data to be classified.

[0046] Step 203 : normalize the edge weights between the central node and the corresponding neighbor nodes in the graph data to be classified, and obtain the normalized edge weights corresponding to each neighbor node in the graph data to be classified.

[0047] Normalization involves limiting the processed data to a specific range. Normalization facilitates subsequent data processing and ensures faster convergence during program execution. The specific purpose of normalization is to summarize and unify the statistical distribution of samples. In this application, the purpose of normalization is to map the edge weights between the central node and each neighboring node into a framework to distinguish the importance of each neighboring node relative to the central node.

[0048] Specifically, in the original data classification method based on graph data, such as the graph convolutional neural network classification model GraphSAGE model, some neighbor aggregation methods in the sampling process are equally weighted, which is generally expressed by the mathematical formula: , where represents the hidden layer features of the sampled neighbor u in the k-1 layer network, and N is the set of sampled neighbor nodes. That is, regardless of whether the edge weight between the central node and the corresponding neighbor node is 0.1 or 0.9, the algorithm will process it the same way. In this case, the aggregation of the central node and the corresponding neighbor nodes will lose the discriminative local features. Therefore, in this application, in order to highlight the discriminative local features in the process of neighbor aggregation, edge weights are introduced in neighbor aggregation to assist sampling and improve the processing effect of neighbor sampling. First, after determining the central node and the corresponding neighbor node, the edge weights between the central node and the corresponding neighbor node are first determined, and then the edge weights between the central node and the corresponding neighbor node in the to-be-classified graph data are normalized to obtain the normalized edge weights corresponding to each neighbor node in the to-be-classified graph data. In this way, the edge weights of each neighbor node relative to the central node are placed in a framework for comparison. By comparing the normalized edge weights of each neighbor node connected to the central node, the importance of the neighbor node relative to the central node can be determined. At the same time, for the second-order neighbor nodes of the first-order neighbor nodes of the central node, the first-order neighbor nodes can be used as the central node and the second-order neighbor nodes as the neighbor nodes to calculate their corresponding normalized edge weights.

[0049] Step 205: Sample the central nodes in the to-be-classified graph data according to the normalized edge weights to obtain node sampling results.

[0050] Specifically, during the data classification process, it is necessary to aggregate the features on the neighbor nodes of the graph data to be classified to the central node to complete the sampling. Moreover, the aggregation process is an equal-weight process, that is, for a weighted graph, the algorithm will still treat it as an unweighted graph, and lose the discriminative local features. Therefore, in the data classification method of the present application, normalized edge weights are introduced, and the features on the neighbor nodes are aggregated to the central node based on the importance of the neighbor nodes relative to the central node to complete the sampling. The features on the original neighbor nodes can be effectively retained, thereby improving the effectiveness of the classification results.

[0051] Step 207 : classify the central node according to the node sampling result of the central node, and obtain the node data classification result corresponding to the graph data to be classified.

[0052] Among them, the node sampling results specifically include the feature data of the central node and the feature data of each neighboring node corresponding to the central node obtained by sampling. These feature data are the basis for node data classification. In the data classification process, the central nodes can be divided into different preset categories based on the different features corresponding to each central node in the graph data to be classified, and the data obtained is the node data classification result. For example, for a social network graph, when it is necessary to classify the actual users in the graph, each user can be regarded as a central node during the calculation, and the node sampling result obtained is the comprehensive feature of the user and the associated users connected to it in the social network graph. Users can be assigned to pre-set user categories based on these features, and after all users in the social network graph are classified, the result is the node data classification result corresponding to the social network graph.

[0053] Specifically, after sampling the central node and obtaining a node sampling result that can effectively utilize the feature information in the neighboring nodes, the subsequent processing process is similar to the current data classification method. Based on the node sampling results corresponding to each central node in these graph data, it can be divided into different categories. For example, in a specific embodiment, data classification is performed based on a trained graph convolutional neural network model. At this time, after sampling the above steps through the graph convolutional neural network and obtaining the node sampling results, the features of the neighboring nodes and the features of the central node can be spliced ​​together based on the aggregator of the graph convolutional neural network model to form an aggregated feature, and then the aggregated feature is processed based on the classifier of the graph convolutional neural network model to obtain the classification result corresponding to the central node. The classification results of all central nodes in the graph data to be classified are aggregated to obtain the node data classification result corresponding to the graph data to be classified. In one embodiment, the data classification method of the present application can be applied to the field of user classification. In another embodiment, as an extension, the data classification method of the present application can be applied to fields such as friend recommendation and advertising recommendation, that is, corresponding friend recommendation and advertising recommendation are performed based on the data classification results.

[0054] The above-mentioned data classification method, during the process of data classification, obtains the graph data to be classified, determines the edge weights between the central node of the graph data to be classified and the corresponding neighbor nodes; normalizes the edge weights between the central node and the corresponding neighbor nodes in the graph data to be classified, and obtains the normalized edge weights corresponding to each neighbor node in the graph data to be classified; samples the central node in the graph data to be classified according to the normalized edge weights, and obtains the node sampling results; classifies the central node according to the node sampling results of the central node, and obtains the node data classification results corresponding to the graph data to be classified. The present application first obtains the normalized edge weights corresponding to each neighbor node in the graph data to be classified, and then samples the central node based on the normalized edge weights, which can effectively utilize the weight data in the graph data to be classified, and the obtained sampling results can effectively utilize the feature information in the neighbor nodes, thereby ensuring the validity of the obtained classification results.

[0055] In one embodiment, Figure 3 As shown, step 203 includes:

[0056] Step 302: Determine the maximum weight value and the minimum weight value among the edge weights between the central node of the graph data to be classified and the corresponding neighbor nodes.

[0057] In step 304, for each central node in the graph data to be classified, the edge weights between each central node and the corresponding neighbor nodes are normalized according to the maximum weight value and the minimum weight value corresponding to the central node, and the normalized edge weights corresponding to the neighbor nodes corresponding to each central node are obtained.

[0058] The maximum weight value represents the neighboring node with the closest connection to the central node, while the minimum weight value represents the neighboring node with the least close connection to the central node. Based on the maximum and minimum weight values ​​of the edge weights between the central node and its corresponding neighboring nodes in the graph to be classified, we can determine the importance interval corresponding to the central node. The weights are then normalized based on this interval.

[0059] Specifically, after obtaining a graph data to be classified and determining the edge weights between the central node of the graph data to be classified and the corresponding neighbor nodes, it is necessary to perform corresponding normalization on these edge weights. At this time, for the normalization of a central node and the corresponding neighbor nodes, the maximum weight value and the minimum weight value of the edge weights corresponding to each selected neighbor node can be determined first, and then the edge weights between the central node and the corresponding neighbor nodes can be normalized based on the maximum weight value and the minimum weight value of the edge weights. The mathematical formula is as follows:

[0060]

[0061] where wu represents the weight of the edge between neighbor node u and the central node, w u represents the normalized edge weight, and w min and w max Respectively represent the minimum and maximum values ​​of the edge weights of all nodes connected to the central node. In this embodiment, the minimum and maximum values ​​of the edge weights can effectively establish a normalization control interval, thereby effectively normalizing the edge weights between the central node and each neighboring node to within this interval, and effectively obtaining the final normalized edge weights.

[0062] In one embodiment, Figure 4 As shown, step 205 includes:

[0063] Step 401: Acquire feature data of neighbor nodes corresponding to each central node in the graph data to be classified.

[0064] Step 403: For each central node in the graph data to be classified, the central node is sampled according to the feature data of the neighboring nodes corresponding to the central node and the normalized edge weights corresponding to the neighboring nodes to obtain the node sampling result corresponding to the central node.

[0065] Specifically, a graph convolutional neural network can be used to perform convolution processing. When the feature data of neighbor nodes are aggregated to the central node through the convolution layer, the central node can be sampled based on the feature data of the neighbor nodes corresponding to the central node and the normalized edge weights corresponding to the neighbor nodes. Specifically, each neighbor node feature point can be multiplied by the normalized weight to achieve the purpose of distinguishing the importance of neighbors. The specific mathematical expression is as follows:

[0066]

[0067] Among them, Aggregate k represents summation, w u represents the normalized edge weight, where represents the hidden layer features of the sampled neighbor u in the k-1th layer of the network, and N is the set of sampled neighbor nodes. In this embodiment, the original hidden layer features are modified by using normalized edge weights, and then aggregate sampling is performed, thereby improving the effectiveness of node sampling data during the aggregate sampling process.

[0068] In one embodiment, Figure 5 As shown, before step 203, the following steps are also included:

[0069] Step 502: For each central node in the graph data to be classified, rank the edge weights between the central node and the corresponding neighbor nodes in descending order to obtain the edge weight ranking corresponding to each central node.

[0070] Step 504: for each central node, retain the top one or more neighbor nodes in the corresponding edge weight ranking, and prune the other neighbor nodes to obtain the pruned graph data to be classified.

[0071] Step 203 includes step 506, normalizing the edge weights between the central node and the corresponding neighbor nodes in the pruned graph data to be classified, and obtaining the normalized edge weights corresponding to each neighbor node in the pruned graph data to be classified.

[0072] In one embodiment of the present application, for each central node, the top one or more neighbor nodes in the corresponding edge weight ranking are retained, and the other neighbor nodes are pruned to obtain the graph data to be classified after the pruning process. Among them, the edge weights corresponding to the other neighbor nodes are relatively small, and they are ranked low in the edge weight ranking. These neighbor nodes with relatively small edge weights are removed through pruning, and the above pruning process is performed on each central node in the graph data to be processed, so that the pruning process of the entire graph data to be processed can be achieved, and the neighbor nodes with relatively small edge weights corresponding to each central node are removed to obtain the graph data to be classified after the pruning process. Since these neighbor nodes with relatively small edge weights have relatively little influence on the characteristics of the central node, in a specific embodiment, by removing these nodes, the stability of the classification results can be improved.

[0073] Specifically, in the original graph data classification method, for example, the GraphSAGE model in the graph convolutional neural network classification model, there is still a process of random sampling of neighbors during the inference process, which will lead to inconsistent results of the same sample in multiple inference processes. In this application, before performing node sampling processing, the original network structure of the graph data to be classified will be pruned, that is, the top K (TopK) neighbor nodes with the highest edge weights of each central node will be retained. The schematic diagram of pruning the graph data to be classified can be referred to Figure 6 , where A is the central node, B and C are neighbor nodes with higher weights, and D is a neighbor node with lower weight. After pruning, D and other neighbor nodes connected to D are pruned. The value of K in TopK is 2, that is, K=2. In this embodiment, there are two advantages to preprocessing the graph network in this way: first, it solves the problem of unstable model results due to random sampling of neighbors; second, it simplifies the graph network structure, which can greatly improve the operation efficiency of the algorithm and reduce the memory consumption of the algorithm.

[0074] In one embodiment, Figure 7 As shown, before step 203, the following steps are also included:

[0075] Step 702: Identify sampling nodes and corresponding sampling neighbor nodes in the graph data to be classified.

[0076] Step 704 : for each sampling node in the graph data to be classified, update the node information of the sampling node according to the node information of the sampling neighbor node corresponding to the sampling node, and obtain the graph data to be classified with updated node information.

[0077] Step 706 : Determine the central node and the corresponding neighbor nodes in the graph data to be classified after the node information is updated from each sampled node and the corresponding sampled neighbor nodes in the graph data to be classified after the node information is updated.

[0078] Step 203 includes step 708, normalizing the edge weights between the central node and the corresponding neighbor nodes in the graph data to be classified after the node information is updated, and obtaining the normalized edge weights corresponding to each neighbor node in the data to be classified after the node information is updated.

[0079] The sampling nodes refer to the nodes selected as central nodes and neighbor nodes in the graph data to be classified.

[0080] Specifically, in the original data classification scheme, as shown in the figure, the convolutional neural network introduces neighbor sampling during the training and inference process, such as Figure 8 The graph structure shown on the left, marked 1 in the figure is the sampling node, marked 2 is the non-sampling node, it can be seen that for a sampled central node, due to the neighbor sampling, the first-order and second-order feature information in most non-sampled nodes cannot be aggregated to the central node, which will lead to the loss of some local information. At this time, it is possible to consider some nodes connected to the sampling node as weakly sampled nodes, and aggregate the information in these nodes into the sampling node to ensure that the local information in the graph can be effectively extracted. Specifically, as Figure 8In the graph structure shown on the right, the nodes directly connected to the sampling node 1 can be considered as sampling neighbor nodes 3, and then the feature information of the unsampled sampling neighbor nodes 3 can be integrated and aggregated into the sampling node 1. In the specific implementation process, since each node in the graph data to be classified needs to be sampled as a central node, for each node, the corresponding sampling node and the corresponding sampling neighbor node in the sampling process must be calculated separately, and then the corresponding feature aggregation preprocessing is performed to ensure the effective aggregation of feature information. In this embodiment, the node information of the sampling neighbor nodes can be identified first, and then this part of the node information is added to the node information of the sampling node, and the node information of the sampling node is updated, so as to ensure that the sampling node can effectively aggregate the feature information in the neighbor nodes, improve the information aggregation efficiency at the central node, and greatly improve the ability of the algorithm to obtain local information of the graph.

[0081] In one embodiment, Figure 9 As shown, step 704 includes:

[0082] Step 902 : Aggregate node feature information of the sampling neighbor nodes corresponding to the sampling node to obtain feature aggregation data.

[0083] Step 904: splice the feature aggregation data into the feature data corresponding to the sampling node to obtain a feature splicing result.

[0084] Step 906: Update the node information of the sampling node according to the feature splicing result.

[0085] Specifically, for the process of updating the node information of the sampling node based on the node information of the sampling neighbor nodes, it is first necessary to aggregate the node feature information of the sampling neighbor nodes corresponding to the sampling node to obtain feature aggregation data. In one embodiment, the mean of the node feature information in these neighbor nodes can be obtained and then used as feature aggregation data. This part of the feature aggregation data is then spliced ​​into the features of the sampling node. For example, the features in the original sampling node are 32-dimensional feature vector data. Since the feature aggregation data is also a 32-dimensional feature vector data, these two 32-dimensional feature vector data can be spliced ​​to obtain a 64-dimensional feature vector data. This 64-dimensional feature vector data is the feature splicing result corresponding to the sampling node. The connection between the feature splicing result and the sampling node can then be established and used as the feature data corresponding to the sampling node. In this embodiment, by aggregating the node feature information in the sampling neighbor nodes and splicing the feature aggregation data with the feature data corresponding to the sampling node, it can be effectively ensured that the sampling node can effectively aggregate the feature information in the surrounding neighbor nodes, improve the information aggregation efficiency at the central node, and greatly enhance the algorithm's ability to obtain local information of the graph.

[0086] In one embodiment, step 207 includes: aggregating the node sampling results to obtain the node aggregation features corresponding to the central node; classifying the central node according to the node aggregation features to obtain the node data classification results corresponding to the graph data to be classified.

[0087] Specifically, the process of aggregating the node sampling results can operate the feature aggregation process in the above step 902. The difference from the above process is that the above process specifically aggregates the features of the unsampled nodes to the neighboring nodes. In this embodiment, the features of the neighboring nodes are aggregated to the central node. In particular, for a multi-structured graph network, the feature aggregation process is also carried out in layers. For example, for a three-layer network, the features of the second-order neighbor nodes can be aggregated to the first-order neighbor nodes first, and then the first-order neighbor nodes can be aggregated to the central node. The final result is the node aggregation feature corresponding to the central node. Based on the node aggregation feature, the central node can be assigned to different preset categories. In a specific embodiment, the classification processing of the nodes in the classified graph data is completed based on the graph convolutional neural network model. At this time, the above-mentioned feature aggregation and feature classification processes can be completed based on the aggregator and classifier in the graph convolutional neural network model, respectively.

[0088] This application also provides an application scenario, which applies the above-mentioned data classification method. Specifically, the application of the data classification method in this application scenario is as follows:

[0089] In a user classification scenario, users need to be appropriately classified based on their social partner types. In this case, classification can be performed using a graph convolutional neural network, while training the graph convolutional neural network based on the data classification method of the present application. Specifically, during implementation of the method, a user's social structure graph can be constructed based on user data. For example, users and chat partners can be considered nodes in a node structure graph, and weights can be assigned to each node based on the chat frequency between the user and the chat partner to construct the graph. The labeled graph data to be classified is then input into server 104, which retrieves the graph data to be classified and, based on the information contained in the graph, determines the edge weights between the central node of the graph data to be classified and its corresponding neighbor nodes. The maximum and minimum weight values ​​of the edge weights between the central node of the graph data to be classified and its corresponding neighbor nodes are then determined. For each central node in the graph data to be classified, the edge weights between each central node and its corresponding neighbor nodes are normalized based on the maximum and minimum weight values ​​corresponding to the central node, obtaining the normalized edge weights corresponding to each neighbor node corresponding to the central node. The algorithm then obtains the feature data of the neighboring nodes corresponding to each central node in the graph data to be classified. For each central node in the graph data to be classified, the algorithm samples the central node based on the feature data of its neighboring nodes and the normalized edge weights corresponding to the neighboring nodes, obtaining the node sampling results corresponding to the central node. The node sampling results are then aggregated to obtain the node aggregate features corresponding to the central node. The central node is then classified based on the node aggregate features to obtain the node data classification results corresponding to the graph data to be classified. Nodes correspond to users, and the node data classification results represent the classification results corresponding to the users. At the same time, the edge weights between the central node and the corresponding neighbor nodes in the graph data to be classified are normalized. Before obtaining the normalized edge weights corresponding to each neighbor node in the graph data to be classified, the process of pruning the graph data to be classified is also included. In this process, for each central node in the graph data to be classified, the edge weights between the central node and the corresponding neighbor nodes can be ranked in descending order to obtain the edge weight ranking corresponding to each central node; for each central node, the top one or more neighbor nodes in the corresponding edge weight ranking are retained, and the other neighbor nodes are pruned to obtain the pruned graph data to be classified.

[0090] In addition, the solution of the present application also includes a pre-aggregation sampling process, which specifically includes: identifying the sampling nodes and corresponding sampling neighbor nodes in the graph data to be classified; updating the node information of the sampling nodes based on the node information of the sampling neighbor nodes to obtain the graph data to be classified after the node information is updated; and determining the central node and corresponding neighbor nodes in the graph data to be classified after the node information is updated from each sampling node and the corresponding sampling neighbor nodes in the graph data to be classified after the node information is updated. Updating the node information of the sampling nodes based on the node information of the sampling neighbor nodes specifically includes: aggregating the node feature information of the sampling neighbor nodes corresponding to the sampling nodes to obtain feature aggregation data; splicing the feature aggregation data into the feature data corresponding to the sampling node to obtain a feature splicing result; and updating the node information of the sampling nodes based on the feature splicing result. The above process of the present application can be specifically implemented based on the GraphSAGE model in the graph convolutional neural network classification model. At this time, the solution also includes the content of the graph convolutional neural network model training part. The model training can adopt a semi-supervised training method. The data processing process of the model training is similar to the above-mentioned data classification process. However, no pruning is required during model training. Because the model training process does not involve the focus of the solution of this application, it will not be repeated here. As shown in Table 1 below, experiments show that when training and testing the graph convolutional neural network classification model GraphSAGE, the classification accuracy of the model can be effectively improved through weighted aggregation, network pruning and pre-aggregation sampling.

[0091] Table 1 Effect of the data classification method proposed in this scheme in the semi-supervised node classification scenario

[0092]

[0093] It should be understood that although Figure 2-9 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 2-9 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The order of execution of these steps or stages is not necessarily one by one, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0094] In one embodiment, Figure 10As shown, a data classification device 100 is provided. The data classification device 100 can be a software module or a hardware module, or a combination of the two to form a part of a computer device. The data classification device 100 specifically includes: a data acquisition module 1001, a normalization processing module 1103, a node sampling module 1105 and a data classification module 1107, wherein:

[0095] The data acquisition module 1001 is used to acquire graph data to be classified and determine the edge weights between the central node of the graph data to be classified and the corresponding neighbor nodes.

[0096] The normalization processing module 1003 is used to normalize the edge weights between the central node and the corresponding neighbor nodes in the graph data to be classified, and obtain the normalized edge weights corresponding to each neighbor node in the graph data to be classified.

[0097] The node sampling module 1005 is used to sample the central nodes in the to-be-classified graph data according to the normalized edge weights to obtain node sampling results.

[0098] The data classification module 1007 is used to classify the central node according to the node sampling result of the central node, and obtain the node data classification result corresponding to the graph data to be classified.

[0099] In one embodiment, the normalization processing module 1003 is specifically used to: determine the maximum weight value and the minimum weight value in the edge weights between the central node and the corresponding neighbor nodes in the graph data to be classified; for each central node in the graph data to be classified, according to the maximum weight value and the minimum weight value corresponding to the central node, normalize the edge weights between each central node and the corresponding neighbor nodes to obtain the normalized edge weights corresponding to the neighbor nodes corresponding to each central node.

[0100] In one embodiment, the node sampling module 1005 is specifically used to: obtain feature data of neighbor nodes corresponding to each central node in the graph data to be classified; for each central node in the graph data to be classified, sample the central node according to the feature data of the neighbor nodes corresponding to the central node and the normalized edge weights corresponding to the neighbor nodes, and obtain the node sampling result corresponding to the central node.

[0101] In one embodiment, the data classification device 100 further includes a pruning module configured to: for each central node in the graph data to be classified, rank the edge weights between the central node and the corresponding neighbor nodes in descending order to obtain the edge weight ranking corresponding to each central node; for each central node, retain the top one or more neighbor nodes in the corresponding edge weight ranking, prune the other neighbor nodes, and obtain the pruned graph data to be classified. The normalization processing module 1003 is further configured to normalize the edge weights between the central node and the corresponding neighbor nodes in the pruned graph data to be classified, and obtain the normalized edge weights corresponding to each neighbor node in the pruned graph data to be classified.

[0102] In one embodiment, the data classification device 100 further includes a pre-aggregation processing module for: identifying sampling nodes and corresponding sampling neighbor nodes in the graph data to be classified; updating the node information of the sampling nodes based on the node information of the sampling neighbor nodes to obtain the graph data to be classified after the node information is updated; and determining the central node and corresponding neighbor nodes in the graph data to be classified after the node information is updated from each sampling node and the corresponding sampling neighbor nodes in the graph data to be classified after the node information is updated. The normalization processing module 1003 is further configured to normalize the edge weights between the central node and the corresponding neighbor nodes in the graph data to be classified after the node information is updated, and obtain the normalized edge weights corresponding to each neighbor node in the graph data to be classified after the node information is updated.

[0103] In one embodiment, the pre-aggregation processing module is also used to: aggregate the node feature information of the sampling neighbor nodes corresponding to the sampling node to obtain feature aggregation data; splice the feature aggregation data into the feature data corresponding to the sampling node to obtain a feature splicing result; and update the node information of the sampling node according to the feature splicing result.

[0104] In one embodiment, the data classification module 1007 is specifically used to: aggregate the node sampling results to obtain the node aggregation features corresponding to the central node; classify the central node according to the node aggregation features to obtain the node data classification results corresponding to the graph data to be classified.

[0105] For the specific definition of the data classification device, please refer to the definition of the data classification method above and will not be repeated here. Each module in the above-mentioned data classification device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software so that the processor can call and execute the operations corresponding to each of the above modules.

[0106] In one embodiment, a computer device 110 is provided. The computer device 110 may be a server, and its internal structure diagram may be as shown in FIG. Figure 11 As shown. The computer device 110 includes a processor 1102, a memory and a network interface 1104 connected via a system bus 1101. The processor 1102 of the computer device 110 is used to provide computing and control capabilities. The memory of the computer device 110 includes a non-volatile storage medium 1105 and an internal memory 1103. The non-volatile storage medium 1105 stores an operating system 1106, a computer program 1107 and a database 1108. The internal memory 1103 provides an environment for the operation of the operating system 1106 and the computer program 1107 in the non-volatile storage medium 1105. The database 1108 of the computer device is used to store input graph data to be classified and operation data during the execution of the data classification method. The network interface 1104 of the computer device is used to communicate with an external terminal via a network connection. When the computer program 1107 is executed by the processor 1102, a data classification method is implemented.

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

[0108] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0109] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above-mentioned method embodiments when executed by a processor.

[0110] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps of each of the above-described method embodiments.

[0111] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

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

[0113] The above embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.

Claims

1. A data classification method, characterized in that: The method comprises: Obtaining graph data to be classified, and determining edge weights between a central node and corresponding neighbor nodes in the graph data to be classified, wherein the graph data to be classified includes nodes representing users and chat objects, respectively. Each central node in the graph data to be classified corresponds to a user, and each neighbor node of the central node corresponds to a chat object of the user. The edge weights between the central node and the corresponding neighbor nodes are determined based on a chat frequency between the user and the chat object, reflecting the closeness of the connection between the user and the chat object. Identify sampling nodes and corresponding sampling neighbor nodes in the graph data to be classified, wherein the sampling nodes are nodes selected as central nodes and neighbor nodes, and the sampling neighbor nodes are non-sampled nodes connected to the sampling nodes; for each sampling node in the graph data to be classified, update the node information of the sampling node according to the node information of the sampling neighbor nodes corresponding to the sampling node, and obtain the graph data to be classified after the node information is updated; from each sampling node and the corresponding sampling neighbor nodes in the graph data to be classified after the node information is updated, determine the central node and the corresponding neighbor nodes in the graph data to be classified after the node information is updated; normalize the edge weights between the central node and the corresponding neighbor nodes in the graph data to be classified after the node information is updated, and obtain the normalized edge weights corresponding to each neighbor node in the graph data to be classified, wherein the normalized edge weights are used to distinguish the importance of the chat objects corresponding to each neighbor node relative to the user corresponding to the central node; Sampling the central node in the graph data to be classified according to the normalized edge weight to obtain a node sampling result, wherein the node sampling result specifically includes feature data of the central node and feature data of each neighboring node corresponding to the central node obtained by sampling; Aggregate the node sampling results to obtain the node aggregation features corresponding to the central node; classify the central node according to the node aggregation features to obtain the node data classification results corresponding to the graph data to be classified, and determine the user classification results of the user corresponding to the central node based on the node data classification results.

2. The method according to claim 1, characterized in that Normalizing the edge weights between the central node and the corresponding neighbor nodes in the graph data to be classified after the node information is updated to obtain the normalized edge weights corresponding to each neighbor node in the graph data to be classified includes: Determine the maximum weight value and the minimum weight value of the edge weights between the central node in the to-be-classified graph data after the node information is updated and the corresponding neighbor nodes; For each central node in the graph data to be classified, the edge weights between each central node and the corresponding neighboring nodes are normalized according to the maximum weight value and the minimum weight value corresponding to the central node, and the normalized edge weights corresponding to the neighboring nodes of each central node are obtained.

3. The method according to claim 2, characterized in that Sampling the central nodes in the graph data to be classified according to the normalized edge weights to obtain node sampling results includes: Obtaining feature data of neighbor nodes corresponding to each central node in the graph data to be classified; For each central node in the graph data to be classified, the central node is sampled according to the feature data of the neighboring nodes corresponding to the central node and the normalized edge weights corresponding to the neighboring nodes to obtain the node sampling result corresponding to the central node.

4. The method according to claim 1, wherein Before normalizing the edge weights between the central node and the corresponding neighbor nodes in the graph data to be classified after the node information is updated and obtaining the normalized edge weights corresponding to each neighbor node in the graph data to be classified, the method further includes: For each central node in the to-be-classified graph data after the node information is updated, the edge weights between the central node and the corresponding neighbor nodes are ranked in descending order to obtain the edge weight ranking corresponding to each central node; For each central node, retain the top one or more neighboring nodes in the corresponding edge weight ranking, and prune the other neighboring nodes to obtain the pruned graph data to be classified; Normalizing the edge weights between the central node and the corresponding neighbor nodes in the graph data to be classified after the node information is updated to obtain the normalized edge weights corresponding to each neighbor node in the graph data to be classified includes: Normalize the edge weights between the central node and the corresponding neighbor nodes in the graph data to be classified after the pruning process to obtain the normalized edge weights corresponding to each neighbor node in the graph data to be classified after the pruning process.

5. The method according to claim 4, characterized in that The updating of the node information of the sampling node according to the node information of the sampling neighbor node includes: Aggregating node feature information of sampling neighbor nodes corresponding to the sampling node to obtain feature aggregation data; Splicing the feature aggregation data into the feature data corresponding to the sampling node to obtain a feature splicing result; The node information of the sampling node is updated according to the feature splicing result.

6. A data classification device, characterized in that: The device comprises: a data acquisition module, configured to acquire graph data to be classified and determine edge weights between a central node and corresponding neighbor nodes in the graph data to be classified, wherein the graph data to be classified includes nodes representing users and chat partners, each central node in the graph data to be classified corresponds to a user, and each neighbor node of the central node corresponds to a chat partner of the user. The edge weights between the central node and the corresponding neighbor nodes are determined based on the chat frequency between the user and the chat partner, reflecting the closeness of the connection between the user and the chat partner; A pre-aggregation processing module is configured to identify sampling nodes and corresponding sampling neighbor nodes in the graph data to be classified, wherein the sampling nodes are nodes selected as central nodes and neighbor nodes, and the sampling neighbor nodes are non-sampled nodes connected to the sampling nodes; for each sampling node in the graph data to be classified, update the node information of the sampling node according to the node information of the sampling neighbor nodes corresponding to the sampling node to obtain the graph data to be classified after the node information is updated; and determine the central node and corresponding neighbor nodes in the graph data to be classified after the node information is updated from each sampling node and the corresponding sampling neighbor nodes in the graph data to be classified after the node information is updated; a normalization processing module, configured to normalize the edge weights between the central node and the corresponding neighbor nodes in the graph data to be classified after the node information is updated, and obtain the normalized edge weights corresponding to each neighbor node in the graph data to be classified, wherein the normalized edge weights are used to distinguish the importance of the chat objects corresponding to each neighbor node relative to the user corresponding to the central node; A node sampling module is used to sample the central node in the graph data to be classified according to the normalized edge weights to obtain a node sampling result, wherein the node sampling result specifically includes feature data of the central node and feature data of each neighboring node corresponding to the central node obtained by sampling; A data classification module is used to aggregate the node sampling results to obtain the node aggregation features corresponding to the central node; classify the central node according to the node aggregation features to obtain the node data classification results corresponding to the graph data to be classified, and determine the user classification results of the user corresponding to the central node based on the node data classification results.

7. The device according to claim 6, characterized in that The normalization processing module is specifically used to: determine the maximum weight value and the minimum weight value in the edge weights between the central node and the corresponding neighbor nodes in the graph data to be classified after the node information is updated; for each central node in the graph data to be classified, according to the maximum weight value and the minimum weight value corresponding to the central node, normalize the edge weights between each central node and the corresponding neighbor node to obtain the normalized edge weights corresponding to the neighbor nodes of each central node.

8. The device according to claim 7, characterized in that The node sampling module is specifically used to: obtain the feature data of the neighbor nodes corresponding to each central node in the graph data to be classified; for each central node in the graph data to be classified, sample the central node according to the feature data of the neighbor nodes corresponding to the central node and the normalized edge weights corresponding to the neighbor nodes, and obtain the node sampling result corresponding to the central node.

9. The device according to claim 6, characterized in that It also includes a pruning module, which is used to: for each central node in the graph data to be classified after the node information is updated, rank the edge weights between the central node and the corresponding neighbor nodes in order from high to low, and obtain the edge weight ranking corresponding to each central node; for each central node, retain the top one or more neighbor nodes in the corresponding edge weight ranking, prune the other neighbor nodes, and obtain the pruned graph data to be classified; the normalization processing module is also used to: normalize the edge weights between the central node and the corresponding neighbor nodes in the graph data to be classified after the pruning processing, and obtain the normalized edge weights corresponding to each neighbor node in the graph data to be classified after the pruning processing.

10. The device according to claim 9, characterized in that The pre-aggregation processing module is also used to: aggregate the node feature information of the sampling neighbor nodes corresponding to the sampling node to obtain feature aggregation data; splice the feature aggregation data into the feature data corresponding to the sampling node to obtain a feature splicing result; and update the node information of the sampling node according to the feature splicing result.

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

12. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Determination method, device and equipment of objective user

    CN104778173A

  • Application program quality identification method and device, computer equipment and storage medium

    CN111177015A