Model training method, and merchant classification method and device

By constructing graph structure data and using graph neural networks to extract sample node vectors, and combining them with label information to train the model, the problem of poor model training results caused by the isolated use of sample features in existing technologies is solved, and the accuracy of the model is improved.

CN113761250BActive Publication Date: 2025-10-17TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110448644.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-25
Publication Date
2025-10-17
Estimated Expiration
2041-05-13

AI Technical Summary

Technical Problem

In the prior art, when using sample data for model training, only the features of each sample are used in isolation, resulting in poor model training results.

Method used

By obtaining sample data and their correlation relationships in the training sample set, graph structure data is constructed, and sample node vectors are extracted using graph neural networks. The preset model is trained by combining the sample node vectors and label information.

Benefits of technology

It improves the model training effect, enhances the accuracy of model processing, and makes full use of the correlation between samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113761250B_ABST
    Figure CN113761250B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a model training method and a merchant classification method and device. The method comprises: obtaining a training sample set; constructing graph structure data between sample data according to the sample data and the correlation relationship between the sample data; inputting the graph structure data into a graph neural network to obtain output sample node vectors; obtaining label information of each sample node vector in a preset scene; training a first preset model using the sample node vectors and the label information corresponding to each sample node vector to obtain a trained first preset model. According to the present application, a machine learning method is used to generate graph structure data according to the correlation relationship between sample data, and then the feature vectors of each sample are extracted from the graph structure data for model training. The method uses the correlation relationship between samples for enhanced training, improves the model training effect, and improves the accuracy of model processing.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a model training method and a merchant classification method and device. BACKGROUND

[0002] Machine Learning (ML) is a branch of computer science that focuses on the development of computer systems able to perform tasks normally requiring human intelligence. Machine learning is a core of artificial intelligence and a fundamental approach to make computer intelligent.

[0003] In the field of machine learning, it is usually necessary to train network models using feature information of sample data to obtain network models with various functions.

[0004] Currently, model training using sample data only uses the features of each sample to train the model, resulting in poor model training effect. SUMMARY

[0005] The embodiments of the present application provide a model training method, a merchant classification method and device, which can generate graph structure data according to the correlation relationship between sample data, and then extract the feature vector of each sample from the graph structure data for model training. The method fully utilizes the correlation between samples, improves the model training effect, and improves the accuracy of model processing.

[0006] The first aspect of the present application provides a model training method, comprising:

[0007] Obtain a training sample set, the training sample set comprising sample data and correlation relationship between sample data;

[0008] Construct graph structure data between the sample data according to the sample data and the correlation relationship between the sample data, the graph structure data comprising sample nodes converted from the sample data and edge relationship data between the sample nodes;

[0009] Input the graph structure data into a graph neural network to obtain a plurality of sample node vectors as output;

[0010] Obtain label information of each sample data in a preset scene;

[0011] Train a first preset model using the plurality of sample node vectors and the label information corresponding to each sample node vector to obtain a trained first preset model.

[0012] Correspondingly, the second aspect of the present application provides a model training device, comprising:

[0013] The first obtaining unit obtains a training sample set, the training sample set including sample data and a correlation degree relationship between the sample data.

[0014] The first constructing unit constructs graph structure data between the sample data according to the sample data and the correlation degree relationship between the sample data, the graph structure data including sample nodes converted from the sample data and edge relationship data between the sample nodes.

[0015] The first input unit inputs the graph structure data into a graph neural network to obtain a plurality of sample node vectors outputted by the graph neural network.

[0016] The second obtaining unit obtains label information of each sample data in a preset scene.

[0017] The first training unit trains a first preset model by using the plurality of sample node vectors and the label information corresponding to each sample node vector to obtain a trained first preset model.

[0018] In some embodiments, the apparatus further includes:

[0019] The third obtaining unit obtains statistical feature data of each sample data.

[0020] The second training unit trains a second preset model by using the statistical feature data of each sample data and the label information of each sample data in the preset scene to obtain a trained second preset model.

[0021] The third training unit trains a preset classification model based on an output of the trained first preset model and an output of the trained second preset model to obtain a trained preset classification model.

[0022] In some embodiments, the third training unit includes:

[0023] The first extracting subunit extracts features of each sample data by using the trained first preset model to obtain a first feature vector.

[0024] The second extracting subunit extracts features of each sample data by using the trained second preset model to obtain a second feature vector.

[0025] The fusion subunit fuses the first feature vector and the second feature vector according to a sample data dimension to obtain a fusion vector corresponding to each sample data.

[0026] The training subunit is configured to train a preset classification model by using the fusion vector corresponding to each sample data and label information of the each sample data in a preset scene, to obtain a trained classification model.

[0027] In some embodiments, the construction unit comprises:

[0028] The generating subunit is configured to generate a plurality of sample nodes by taking sample data in the sample data set as nodes.

[0029] The connecting subunit is configured to connect edges between sample nodes whose association degree relationship satisfies a preset condition, to obtain graph structure data between sample data.

[0030] In some embodiments, the connecting subunit comprises:

[0031] The computing module is configured to calculate spatial distance information between each sample node.

[0032] The connecting module is configured to connect edges between sample nodes whose spatial distance information is less than a preset threshold.

[0033] In some embodiments, the input unit comprises:

[0034] The obtaining subunit is configured to obtain graph structure type information of the graph structure data.

[0035] The determining subunit is configured to determine a target graph embedding method corresponding to each graph structure type information.

[0036] The processing subunit is configured to process graph structure data of corresponding graph structure type information based on the target graph embedding method, to obtain a sample node vector corresponding to each sample node in the graph structure data.

[0037] In some embodiments, the first training unit is further configured to:

[0038] The first training unit is further configured to train a preset multi-layer perceptron by using the plurality of sample node vectors and label information corresponding to each sample node vector, to obtain a trained preset multi-layer perceptron.

[0039] The third aspect of the present application further provides a merchant classification method, which comprises:

[0040] Obtaining a merchant data set, which comprises merchant information of a plurality of merchants and association degree relationships between the merchants;

[0041] Constructing graph structure data between the merchants according to the merchant information of the plurality of merchants and the association degree relationships between the merchants;

[0042] input the graph structure data into a graph neural network to obtain a plurality of merchant node vectors output;

[0043] input the plurality of merchant node vectors into a preset first model to classify the plurality of merchants under a preset scenario, the preset model being a trained first preset model provided in the above embodiments.

[0044] Correspondingly, the fourth aspect of the present application also provides a merchant classification device, the device comprising:

[0045] a fourth acquisition unit configured to acquire a merchant data set, the merchant data set containing merchant information of a plurality of merchants and an association degree relationship between the merchants;

[0046] a second construction unit configured to construct graph structure data between the merchants according to the merchant information of the plurality of merchants and the association degree relationship between the merchants;

[0047] a second input unit configured to input the graph structure data into a graph neural network to obtain a plurality of merchant node vectors output;

[0048] a first classification unit configured to input the plurality of merchant node vectors into a preset first model to classify the plurality of merchants under a preset scenario, the preset model being a trained first preset model provided in the above embodiments.

[0049] In some embodiments, the device further comprises:

[0050] a second acquisition unit configured to acquire statistical feature data of each merchant;

[0051] a processing unit configured to process a merchant node vector corresponding to each merchant through the preset first model to obtain a first feature vector corresponding to each merchant;

[0052] an extraction unit configured to perform feature extraction on the statistical feature data of each merchant through a preset second model to obtain a second feature vector corresponding to each merchant, the preset second model being a trained second preset model provided in the above embodiments;

[0053] a fusion unit configured to fuse the first feature vector and the second feature vector of each merchant to obtain a fusion vector of each merchant;

[0054] a second classification unit configured to input the fusion vector of each merchant into a preset third model to classify the merchants, the preset third model being a trained classification model provided in the above embodiments.

[0055] The fifth aspect of the present application also provides a computer readable storage medium, which stores a plurality of instructions, the instructions being adapted to be loaded by a processor to execute the steps of the model training method provided in the first aspect of the present application or the steps of the merchant classification method provided in the third aspect of the present application.

[0056] The sixth aspect of the present application provides a computer device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the model training method provided in the first aspect of the present application or the steps of the merchant classification method provided in the third aspect of the present application when executing the computer program.

[0057] The seventh aspect of the present application provides a computer program product or a computer program, which comprises computer instructions stored in a storage medium. A processor of a computer device reads the computer instructions from the storage medium, and the processor executes the computer instructions so that the computer device executes the steps of the model training method provided in the first aspect or the steps of the merchant classification method provided in the third aspect of the present application.

[0058] The model training method provided in the embodiments of the present application comprises the following steps: obtaining a training sample set, the training sample set comprising sample data and a correlation degree relationship between the sample data; constructing graph structure data between the sample data according to the sample data and the correlation degree relationship between the sample data, the graph structure data comprising sample nodes converted from the sample data and edge relationship data between the sample nodes; inputting the graph structure data into a graph neural network to obtain a plurality of output sample node vectors; obtaining label information of each sample node vector in a preset scene; training a first preset model by using the plurality of sample node vectors and the label information corresponding to each sample node vector to obtain a trained first preset model. In this way, the graph structure data is generated according to the correlation degree relationship between the sample data, and then the feature vectors of each sample are extracted from the graph structure data for model training. The method uses the correlation degree relationship between the samples for enhanced training, improves the model training effect and improves the accuracy of model processing. BRIEF DESCRIPTION OF DRAWINGS

[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0060] Figure 1 The present application provides a scene diagram of model training;

[0061] Figure 2 is a flowchart of a model training method provided by the present application;

[0062] Figure 3 is another flowchart of a model training method provided by the present application;

[0063] Figure 4 is a structural diagram of a double-tower model provided by the present application;

[0064] Figure 5 is a flowchart of a merchant classification method provided by the present application;

[0065] Figure 6 is a structural diagram of a model training device provided by the present application;

[0066] Figure 7 is a structural diagram of a merchant classification device provided by the present application;

[0067] Figure 8 is a structural diagram of a computer device provided by the present application. DETAILED DESCRIPTION

[0068] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

[0069] The embodiments of the present application provide a model training method, a merchant classification method and device. The model training method can be used in a model training device. The model training device can be integrated in a computer device, which can be a terminal or a server. The terminal can be a mobile phone, a tablet computer, a notebook computer, a smart television, a wearable smart device, a personal computer (PC), and the like. The server can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery network (CDN), and basic cloud computing services such as big data and artificial intelligence platforms.

[0070] Please refer to Figure 1As shown in the figure, after the computer device obtains the training sample set, the computer device extracts the correlation degree relationship between the sample data from the training sample set, and then correlates the sample data according to the correlation degree relationship between the sample data, so as to construct the graph structure data between the sample data. Then, the computer device inputs the constructed graph structure data into the graph neural network to obtain the output sample node vector. Finally, the pre-set network model is trained according to the sample node vector corresponding to each sample data and the label information corresponding thereto, to obtain the trained network model, so as to realize the model training process.

[0071] It should be noted that Figure 1 The model training scene diagram shown is only an example, and the model training scene described in the embodiments of the present application is used to more clearly illustrate the technical solutions of the present application, and does not constitute a limitation on the technical solutions provided by the present application. It is known to those skilled in the art that with the evolution of model training and the emergence of new business scenarios, the technical solutions provided by the present application are also applicable to similar technical problems.

[0072] The above implementation scenarios are described in detail below.

[0073] The embodiments of the present application will be described from the perspective of a model training device, which can be integrated in a computer device. The computer device can be a terminal or a server. As shown in the figure Figure 2 The flowchart of the model training method provided by the present application is shown in the figure, and the method comprises the following steps:

[0074] In step 101, a training sample set is obtained, and the training sample set comprises merchant information of a plurality of merchants and correlation degree relationships between the merchants.

[0075] At present, when sample data is used for model training, only the features of the sample itself are considered in isolation, and the correlation between samples is ignored, resulting in poor model training effect. The features of the sample itself include the features corresponding to the basic information of the sample.

[0076] To this end, to solve the above problems, the present application provides a model training method, which can fully utilize the correlation between samples to train the model to improve the accuracy of model training. The model training method provided by the present application is introduced as follows: first, the training sample set required for model training is obtained, and the training sample set includes sample data and the correlation between sample data. In the present application, the merchant classification scenario is taken as an example for illustration, and the training sample set includes multiple merchant data and the correlation between merchants. It can be understood that the merchant classification scenario is only an example, and the model training method provided by the present application can be applied to any classification scenario. The merchant classification scenario is only an example for the convenience of understanding the technical solution of the present application, and does not limit the protection scope of the present application.

[0077] The merchant data can include merchant information of the merchant, one or more feature data of the merchant, and correlation data between the merchants. The merchant information includes the basic information of the merchant, including the business scope, name, address, and establishment time of the merchant. The one or more feature data of the merchant can include data corresponding to different scene pain points in multiple scenarios.

[0078] The correlation between the merchants can be obtained by processing the correlation data of the merchants. Specifically, the correlation data of the merchants can be obtained according to a preset acquisition logic, or can be obtained by reasoning based on the basic information of the merchants. After obtaining the correlation between the merchants, a preset correlation calculation method can be used to calculate the correlation between the merchants, or a trained correlation analysis model can be used to analyze the correlation data between the merchants to obtain the correlation between the merchants.

[0079] Step 102, constructing a graph structure data between the merchants according to the merchant information of the multiple merchants and the correlation between the merchants.

[0080] After obtaining the training sample data, the graph structure data between the sample data is constructed based on the sample data and the correlation between the sample data included in the training sample data. The nodes in the graph structure data, also known as sample nodes, represent a sample data. The edges connecting the sample nodes in the graph structure represent the correlation between the sample data. Specifically, in the merchant classification scenario, the graph structure data between the merchants can be constructed based on the merchant information of the multiple merchants and the correlation between the merchants. The nodes in the graph structure data represent a merchant, and the edges connecting the nodes represent the correlation between the merchants.

[0081] In some embodiments, the graph structure data between the sample data is constructed according to the sample data and the correlation degree relationship between the sample data, including:

[0082] 1. Sample data in the sample data set is taken as a node to generate a plurality of sample nodes.

[0083] 2. The sample nodes whose correlation degree relationship meets a preset condition are connected by an edge to obtain the graph structure data between the sample data.

[0084] In some embodiments, the graph structure data between the sample data is constructed according to the sample data and the correlation degree relationship between the sample data, including:

[0085] In some embodiments, the sample nodes whose correlation degree relationship meets a preset condition are connected by an edge, including:

[0086] 1.1. The spatial distance information between each sample node is calculated.

[0087] 1.2. The sample nodes whose spatial distance information is less than a preset threshold are connected by an edge.

[0088] In some embodiments, the correlation degree relationship between the sample data is mapped to obtain an association degree value, and then the connection relationship between the sample nodes is determined according to the association degree value between the sample data. Specifically, the association degree value between the sample nodes can be compared with a preset threshold value, and when the association degree value is greater than the preset threshold value, an edge connection is established between the two sample nodes. When the association degree value is not greater than the preset threshold value, i.e. no edge connection is established between the two sample nodes. Similarly, in the merchant classification scenario, the association degree value between the merchants can also be compared with a preset threshold value, and then the merchant nodes whose association degree value is greater than the preset threshold value are connected by an edge to obtain the graph structure data corresponding to the merchants.

[0089] Step 103. The graph structure data is input into a graph neural network to obtain a plurality of output merchant node vectors.

[0090] In the embodiments of the present application, after the graph structure data between the sample data is constructed, a graph neural network (GNN) is used to extract features of the graph structure data. Specifically, the graph structure data can be input into the graph neural network to obtain a plurality of sample node vectors output by the graph neural network.

[0091] The graph neural network technology belongs to the field of artificial intelligence technology. Artificial intelligence technology is a comprehensive discipline, involving a wide range of fields, both hardware and software technologies. Artificial intelligence basic technologies generally include technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, large information processing technology, operation / interaction system, mechatronics, etc. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning, etc. Machine learning (ML) is a multi-disciplinary subject, involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, etc. It is a subject that studies how computers simulate or implement human learning behavior to acquire new knowledge or skills, and reorganize existing knowledge structure to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental approach to making computers intelligent, and its applications are widespread in various fields of artificial intelligence. Machine learning and deep learning generally include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and inductive learning.

[0092] In the embodiments of the present application, the graph neural network can use the features of the merchant nodes and the positional relationship of the merchant nodes in the graph structure data to perform graph convolution calculation, thereby outputting the merchant node vectors corresponding to the merchant nodes. The graph convolution calculation generalizes the convolution operation from traditional data to graph data, and its core idea is to learn a function mapping, which enables the nodes in the graph to aggregate their own features and neighbor features to generate new representations of the nodes. That is, after the graph structure data between the merchants is input into the graph neural network, each merchant node will process its own features and the features of its neighbor merchant nodes according to a predetermined mapping relationship to obtain a new representation of the merchant node, i.e., the merchant node vector of the merchant node.

[0093] In some embodiments, the graph structure data is input into the graph neural network to obtain a plurality of sample node vectors output, including:

[0094] 1. Obtain graph structure type information of the graph structure data;

[0095] 2. Determine a target graph embedding method corresponding to each graph structure type information;

[0096] 3. The target graph embedding method is used to process the graph structure data of the corresponding graph structure type information to obtain a sample node vector corresponding to each sample node in the graph structure data.

[0097] In the embodiments of the present application, the graph embedding (GE) method can also be used to process the graph structure data to obtain a sample node vector corresponding to each sample node. Graph embedding aims to represent the vertices in the graph as low-dimensional vectors by preserving the network topology and node content information of the graph, so as to be processed by using a simple machine learning algorithm (for example, a support vector machine classification). Many graph embedding algorithms are generally unsupervised algorithms, which can be roughly divided into three categories, namely matrix decomposition, random walk and deep learning method. At the same time, the deep learning method of graph embedding also belongs to graph neural network, including algorithms based on graph autoencoder, such as Structral Deep Network Embedding (SDNE), and unsupervised training of graph convolutional neural network (such as GraphSage).

[0098] Graph embedding is to map an attribute graph to a vector space according to a certain function relationship, so as to convert it into one or a group of vectors. The embedding should capture the topology of the graph, the relationship between the vertices, and other related information about the graph, subgraph and vertex. Using the graph embedding method to encode the graph relationship can also be divided into vertex embedding method and graph embedding method. The vertex embedding method uses a vector representation of each vertex to encode the graph relationship. In the embodiments of the present application, the vector representation of each merchant node is used to encode the graph structure data between the merchants. When visualization or prediction needs to be performed at the vertex level, this embedding method is used, for example, the vertex embedding method can be used in the merchant classification scenario exemplified in the present application. The graph embedding method uses a vector to represent the entire graph, which is used when prediction needs to be made at the graph level, and when we want to compare or visualize the entire graph, for example, when comparing chemical structures.

[0099] In the embodiments of the present application, each sample node in the graph structure data constructed can be a same type of sample node or different types of sample nodes. In the exemplified merchant classification scenario, the merchant nodes in the graph structure data between the merchants are the same type of sample nodes, so the graph structure type information of this graph structure data is a homogenous graph. In some cases, each sample node in the constructed graph structure data can also be a different type of sample node. For example, in the merchant transaction network, there are two types of sample nodes, namely merchant nodes and user nodes; in the user interest network, there can be multiple sample nodes such as user nodes, article nodes, author nodes and public number nodes. The graph structure type information of such graph structure data is a heterogeneous graph.

[0100] For the graph structure data of different graph structure type information, different graph embedding methods can be used for encoding to obtain better encoding effect. For example, when the graph structure type information is a heterogeneous graph, a Metapath2Vec graph embedding algorithm can be used to encode to obtain the merchant node vectors corresponding to different merchant nodes. When the graph structure type information is a homogeneous graph, a Deepwalk, Node2vec, Line or GraphSage graph embedding algorithm can be used to encode to obtain the merchant node vectors corresponding to different nodes.

[0101] In some cases, when the features of some vertices in the heterogeneous graph are not needed for model training, the heterogeneous graph can also be converted into a homogeneous graph through certain logical conversion, and then the graph structure data is encoded using the corresponding graph embedding method of the homogeneous graph. For example, in the merchant classification scenario, edges can be established between merchants with the same payment user to convert the merchant-user heterogeneous graph into a merchant-merchant homogeneous graph for processing.

[0102] In the embodiments of the present application, the graph embedding method is used to encode the graph relationship, that is, the graph structure data is processed using the graph embedding method, which has obvious advantages over using statistical features to encode the graph relationship. Although using statistical features to encode the graph relationship has the advantages of clear business logic and strong interpretability, it is easier to implement distributed computing under simple business logic. However, it can only simply calculate some prior features, and it is difficult to describe some complex network associations. In addition, statistical features need to be counted from the pain points of the scene, and when the scene pain points are not accurately determined, it is easy to miss features. Using the graph embedding method to encode the graph relationship can accurately describe complex network associations, and does not require manual thinking of the description logic of the graph relationship, which is more efficient and will not miss features.

[0103] Step 104, obtaining label information of each merchant information in a preset scene.

[0104] Wherein, after adopting the graph neural network to extract a plurality of sample node vectors from the graph structure data, the model needs to be trained using the sample node vectors and the label information corresponding to the sample node vectors. Therefore, the label information corresponding to each sample node vector needs to be obtained. In the embodiments of the present application, the label information corresponding to each merchant node vector, i.e., the label information corresponding to each merchant data, can be obtained. Since a large number of statistical features of merchants and the correlation relationship between merchants are adopted when constructing the graph structure data between merchants, the merchant node vector extracted by the graph neural network can also be suitable for model training in multiple scenarios. However, the label information corresponding to the merchant node vector in different scenarios is not necessarily the same. For example, in the scenario of classifying merchants into supermarkets and real estate merchants and in the scenario of distinguishing whether a merchant is a credit merchant, the label information corresponding to the same merchant is not necessarily the same. Wherein, the label information can be 0 and 1. Specifically, for example, in the scenario of classifying merchants into supermarkets and real estate merchants, 0 represents a supermarket and 1 represents a real estate merchant; in the scenario of distinguishing whether a merchant is a credit merchant, 0 represents a non-credit merchant and 1 represents a credit merchant.

[0105] Therefore, before obtaining the label information corresponding to each sample node vector, the scenario needs to be determined first. Then the label information corresponding to the scenario is obtained, i.e., the label information of each sample data under the preset scenario is obtained. In the merchant classification scenario, the next level scenario also needs to be determined specifically, which can be determined as the preset scenario. Thus, the label information corresponding to each merchant information under the preset scenario is obtained, and the label information corresponding to each merchant node vector under the preset scenario is obtained.

[0106] Step 105, training the classification model using a plurality of merchant node vectors and the label information corresponding to each merchant node vector to obtain a trained classification model.

[0107] Wherein, after obtaining the label information corresponding to each sample node vector under the preset scenario, the sample node vector can be used as the input and the label information corresponding to the sample node vector can be used as the output to train the network model. Specifically, in the merchant classification scenario, the merchant node vector can be used as the input and the label information corresponding to the merchant node vector can be used as the output to train the classification model to obtain a trained classification model.

[0108] Then, the trained classification model can be used to classify the merchant, wherein the classification model is suitable for merchant classification in a preset scene. For example, when the label information corresponding to the merchant node vector is obtained in the scene of judging whether the merchant is a credit merchant, the trained classification model is suitable for the scene of judging whether the merchant is a credit merchant. When a merchant information is input into the trained classification model, the merchant can be output as a credit merchant or a non-credit merchant.

[0109] Therefore, the model training method provided in the present application can obtain a model for processing sample data in different scenes by only obtaining label information corresponding to sample data in different scenes. The model training efficiency is greatly improved without determining and counting statistical characteristics corresponding to sample data for different scenes. Moreover, the model training method provided in the present application also considers the association relationship between sample data, so that the model training effect is better, and the accuracy of data processing by the trained model is higher.

[0110] In some embodiments, the classification model trained in the present application can be a multilayer perceptron (MLP). Since both the graph neural network and the graph embedding method process graph structure data, the output is a sample node vector. The multilayer perceptron has good processing performance for dense vectors, so training the multilayer perceptron using the sample node vector and the label information corresponding to the sample node vector can further improve the model training efficiency.

[0111] In some embodiments, the model training method provided in the present application can further include:

[0112] 1. Obtain statistical characteristic data of each sample data;

[0113] 2. Train a second preset model using the statistical characteristic data of each sample data and the label information of each sample data in a preset scene to obtain a trained second preset model;

[0114] 3. Train a preset classification model based on the output of the trained first preset model and the output of the trained second preset model to obtain a trained preset classification model.

[0115] The statistical feature data of the sample, or the statistical feature of the sample, refers to some specific feature information of the subject, which is generally used for machine learning modeling and target prediction in a business scenario. Specifically, for example, in the scenario of merchant classification, it is necessary to distinguish whether a merchant is a supermarket or a real estate merchant. The frequency of user transactions with the merchant can be counted. Frequency statistics can be in units of days, months, or years. Then, the merchant with which the user transacts more than a preset frequency can be determined as a supermarket, and vice versa, the merchant with which the user transacts less than the preset frequency can be determined as a real estate merchant. In this scenario, the frequency of user transactions with the merchant is the statistical feature of each merchant. According to the statistical feature, a merchant classification model can be established and trained, and then each merchant can be classified according to the trained model. Or, in the anti-fraud scenario, fraudsters often use the same device to register multiple different accounts to contact victims. Therefore, the number of accounts associated with each device can be counted, and when the number of accounts associated with a device is greater than a preset number, the device can be determined as a fraudster's device. In this scenario, the number of accounts associated with each device is the statistical feature corresponding to the device. A device classification model can be established and trained based on the statistical feature, and then each device can be classified according to the trained model. Alternatively, in the scenario of evaluating the credit mind of a user, the number of credit articles read by the user can be obtained and used as a statistical feature for modeling and training.

[0116] As described above, using the statistical feature data of the sample data to encode the graph relationship has the advantages of clear business logic, strong interpretability, and easier distributed computing under simple business logic. Therefore, the present inventors propose a model training method for training a double-tower model, which can further improve the accuracy of data processing of the trained model.

[0117] Specifically, the statistical feature data of each sample data can be obtained, and then the statistical feature data of the sample data and the label information of the sample data in a preset scenario are used for model training. Here, the model trained using the aforementioned sample node vector can be determined as a first model, and the model trained using the statistical feature data here can be determined as a second model. Generally, the model trained using the statistical feature is usually a gradient boosting decision tree (Xgboost) model. However, the output of the Xgboost model is difficult to fuse with the output of the artificial neural network model. Therefore, to enable the output of the second model to be fused with the output of the first model, the model trained using the statistical feature data in the present application is also an artificial neural network model, which can be a multilayer perceptron.

[0118] After the training of the first model and the second model is completed, a classification model can be further trained based on the output of the trained first model and the output of the trained second model, and the classification model can be a logistic regression model. Specifically, for any target merchant, the trained first model can be used to perform feature extraction on the merchant node vector to obtain a first feature vector after dimension reduction; the trained second model is used to perform feature extraction on the statistical data of the merchant to obtain a second feature vector. Then the first feature vector and the second feature vector are fused to obtain a fusion vector. Finally, a logistic regression model is trained using the fusion vector of each merchant and the label information of the merchant in the preset scene to obtain the trained classification model.

[0119] According to the above description, the model training method provided by the embodiments of the present application can obtain a training sample set, the training sample set includes sample data and the correlation degree relationship between the sample data; construct a graph structure data between the sample data according to the sample data and the correlation degree relationship between the sample data, the graph structure data includes sample nodes converted from the sample data and edge relationship data between the sample nodes; input the graph structure data into a graph neural network to obtain a plurality of output sample node vectors; obtain label information of each sample node vector in a preset scene; train a first preset model using a plurality of sample node vectors and the label information corresponding to each sample node vector to obtain a trained first preset model. In this way, by generating graph structure data according to the correlation degree relationship between the sample data, and extracting the feature vector of each sample from the graph structure data for model training, the method uses the correlation degree relationship between the samples for enhanced training, improves the model training effect, and improves the accuracy of model processing.

[0120] Correspondingly, the embodiments of the present application will further describe the model training method provided by the present application from the perspective of a computer device, which can be a terminal or a server. As shown in Figure 3 The model training method provided by the present application includes the following steps:

[0121] Step 201, the computer device obtains a merchant relationship graph.

[0122] In the embodiments of the present application, the computer device can directly obtain the merchant relationship graph, and in the merchant relationship graph, each node represents a merchant, each merchant node further includes merchant information of the merchant and statistical feature information related to the merchant, and the edges between the nodes represent the association relationship between the merchants.

[0123] In some embodiments, the computer device can also obtain training sample data containing merchant information of a plurality of merchants and association relationships between the merchants. Then, each merchant can be taken as a node to generate a plurality of merchant nodes. Then, the connection relationships between the merchant nodes can be determined according to the association relationships between the merchants. Specifically, an edge connection can be established between merchant nodes whose association relationships satisfy preset conditions, so as to obtain a merchant relationship graph.

[0124] In step 202, the computer device encodes the merchant relationship graph by using a graph embedding method to obtain a merchant node vector corresponding to each merchant.

[0125] The encoding of the merchant relationship graph by using the graph embedding method can be divided into two categories: supervised algorithm and unsupervised algorithm. The supervised algorithm is to encode using vertex label information, and a representative of the supervised algorithm is GraphSage. The process is to aggregate the feature information of neighboring vertices on each vertex of the graph to generate the embedded expression of the vertex, that is, to obtain the vector of each vertex. Then, a classifier is trained based on the vector of each vertex to optimize the classification effect of the vertex. The supervised algorithm can better combine the target scene for learning and train the vector expression required by the downstream scene.

[0126] The unsupervised algorithm encodes using graph relationship information, and a representative of the unsupervised algorithm is DeepWalk, Node2Vec, and Line. The basic assumption is that neighboring vertices in the graph structure have similarity. Therefore, after generating a vertex sequence by random walk, the embedded expression of the vertex is generated based on the idea of Word2Vec. The unsupervised algorithm can better capture the context information of the local structure and depict the similarity of neighboring vertices.

[0127] In the embodiments of the present application, the supervised algorithm GraphSage can be used to extract the merchant node vector corresponding to each merchant, so as to realize the encoding of the merchant relationship graph.

[0128] In step 203, the computer device obtains label information corresponding to each merchant node vector in a preset scene.

[0129] The use scene of the model can be determined according to the needs of the user. Then, the label information corresponding to the use scene can be determined from the merchant relationship graph or the obtained sample training set according to the use scene of the model. The label information corresponds to the merchant information of each merchant one by one, and also corresponds to the merchant node vector determined in step 202 one by one. Thus, the label information of each merchant node vector in the preset scene is determined. The label information can be 0 or 1. For example, in the scene of classifying merchants into honest merchants, when a merchant is an honest merchant, the label information corresponding to the merchant is 1; when the merchant is a non-honest merchant, the label information corresponding to the merchant is 0.

[0130] In step 204, the computer device trains the first multi-layer perception machine by using the merchant node vector corresponding to each merchant and the label information corresponding to each merchant node vector to obtain a trained first multi-layer perception machine.

[0131] In the above process, after the merchant node vector corresponding to each merchant and the label information corresponding to each merchant node vector are determined, the first multi-layer perception machine is trained by using the merchant node vector corresponding to each merchant as input and the label information corresponding to each merchant node vector as output to obtain the trained first multi-layer perception machine.

[0132] In the process of classifying the merchants, the target merchant node vector corresponding to the target merchant can be generated by using the aforementioned graph embedding method, and then the target merchant node vector is input into the trained first multi-layer perception machine, so that the classification result of the target vector output by the trained first multi-layer perception machine can be obtained.

[0133] In step 205, the computer device obtains the statistical features of each merchant.

[0134] The statistical features of the merchants are features that are counted for the above-mentioned preset scenarios. For example, in the scenario of judging whether a merchant is a honest merchant, the number of complaints of dishonest behavior of the merchant by the user can be used as the statistical feature of the merchant. Whether the merchant is a honest merchant or a dishonest merchant can be determined according to the number of complaints of dishonest behavior corresponding to each merchant.

[0135] In step 206, the computer device trains the second multi-layer perception machine by using the statistical features of each merchant and the label information corresponding to each merchant to obtain a trained second multi-layer perception machine.

[0136] In the above process, after the statistical features of each merchant are obtained, the statistical features of each merchant in the preset scenario are used as input, and the label corresponding to each merchant is used as output to train the second multi-layer perception machine to obtain the trained second multi-layer perception machine. Since the second multi-layer perception machine is trained only by using the statistical features of the merchants, and does not use the association relationship between the merchants, the classification effect of the trained second multi-layer perception machine is slightly inferior to that of the trained first multi-layer perception machine.

[0137] In step 207, the computer device obtains the first feature vector obtained by processing the merchant node vector corresponding to each merchant by the trained first multi-layer perception machine, and obtains the second feature vector obtained by processing the statistical features corresponding to each merchant by the trained second multi-layer perception machine.

[0138] The trained multi-layer perceptron is used to classify the features, and the specific process is to first perform dimension reduction processing on the features to obtain a new feature vector, and then classify the obtained new feature vector to obtain a classification result.

[0139] In the embodiment of the application, after obtaining the trained first multi-layer perceptron and the trained second multi-layer perceptron, the trained first multi-layer perceptron and the trained second multi-layer perceptron can be used to perform dimension reduction processing on the graph features (i.e., the merchant node vector) and the statistical features of the merchant, respectively, to obtain a first feature vector corresponding to the graph features of the merchant and a second feature vector corresponding to the statistical features of the merchant.

[0140] In step 208, the computer device fuses the first feature vector and the second feature vector to obtain a fusion vector corresponding to each merchant.

[0141] In the embodiment of the application, after obtaining the first feature vector and the second feature vector corresponding to each merchant, the first feature vector and the second feature vector corresponding to each merchant are fused to obtain a fusion vector corresponding to each merchant. Specifically, the first feature vector and the second feature vector can be spliced to obtain a fusion vector corresponding to each merchant.

[0142] In step 209, the computer device trains a logistic regression model according to the fusion vector corresponding to each merchant and the label data corresponding to each merchant to obtain a trained logistic regression model.

[0143] After determining the fusion vector corresponding to each merchant, the computer device takes the fusion vector corresponding to each merchant as input and takes the label information corresponding to each merchant as output to train the logistic regression model again to obtain a trained logistic regression model. Since the input of the logistic regression model is the fusion vector of the feature vectors output by the first multi-layer perceptron and the second multi-layer perceptron, the logistic regression model has the feature extraction advantages of the first multi-layer perceptron and the second multi-layer perceptron, so that the classification effect of the trained model is better. Further improve the accuracy of classification by the trained model. That is, the application provides a double-tower model that extracts features from the graph features and the statistical features of the merchant, respectively, and fuses the extracted feature vectors for training to obtain a classification model with better classification effect.

[0144] As Figure 4As shown, a structural diagram of the double-tower model provided in the present application is shown. Specifically, whether in the model training phase or in the model use phase, the first multi-layer perceptron B can be used to extract features of the merchant corresponding graph features A to obtain the first feature vector C; then the second multi-layer perceptron E is used to extract the statistical features D corresponding to the merchant to obtain the second feature vector F. Then the first feature vector C and the second feature vector F are fused to obtain the fusion vector G. In the model training phase, the fusion vector G and the corresponding label information, i.e. the classification result I, can be used to train the logistic regression model H. In the model use phase, the fusion vector G can be input into the logistic regression model H to obtain the classification result I.

[0145] Specifically, as shown in Table 1, a statistical table of the Kolmogorov-Smirnov (KS) value and the Area Under Curve (AUC) value of the models obtained by using different graph embedding methods for feature extraction and modeling in specific use scenarios is shown, wherein the KS value reflects the discrimination of the model for positive and negative samples, and generally speaking, the larger the value, the stronger the ability of the model to distinguish positive and negative samples. The AUC value reflects the probability that the prediction result of the positive sample is greater than the prediction result of the negative sample, and the larger the AUC value, the better the classification effect of the model, and when the AUC value reaches 1, it means that the corresponding model is a perfect classifier. As can be seen from Table 1, whether it is the first multi-layer perceptron (corresponding to modeling based on the graph features of the merchant) or the logistic regression model (corresponding to joint modeling based on the graph features and statistical features of the merchant) obtained by the model training method provided in the present application, the classification effect is greatly improved. Moreover, as can be seen from Table 1, the classification effect of the logistic regression model obtained by joint modeling is better. Moreover, for the same model, using different graph embedding methods to extract graph features, the training effect of the corresponding model is also different. The classification effect of the model obtained by using supervised algorithm for graph feature extraction and model training is better.

[0146]

[0147] Table 1

[0148] According to the above description, the model training method provided by the embodiment of the application can obtain a training sample set, the training sample set including sample data and a correlation degree relationship between the sample data; construct graph structure data between the sample data according to the sample data and the correlation degree relationship between the sample data, the graph structure data including sample nodes converted from the sample data and edge relationship data between the sample nodes; input the graph structure data into a graph neural network to obtain a plurality of output sample node vectors; obtain label information of each sample node vector in a preset scene; train a first preset model using the plurality of sample node vectors and the label information corresponding to each sample node vector to obtain a trained first preset model. In this way, the graph structure data is generated according to the correlation degree relationship between the sample data, and then the feature vectors of each sample are extracted from the graph structure data for model training. The method uses the correlation degree relationship between the samples for enhanced training, improves the model training effect, and improves the accuracy of model processing.

[0149] The embodiment of the application will be described from the perspective of a merchant classification device, which can be integrated in a computer device. The computer device can be a terminal or a server. Figure 5 As shown in the flowchart of the merchant classification method provided by the application, the method includes the following steps:

[0150] Step 301: Obtain a merchant data set.

[0151] The merchant data set can include one merchant data or multiple merchant data. When the merchant data set contains only one merchant data, the merchant data contains the merchant information of the merchant. When the merchant data set contains multiple merchant data, each merchant data contains the merchant information of the merchant, and in addition, the merchant data includes the correlation degree relationship between the merchants in the merchant data set.

[0152] Step 302: Construct graph structure data between the merchants according to the merchant information of the multiple merchants and the correlation degree relationship between the merchants.

[0153] When the merchant data set contains multiple merchant data, the graph structure data between the merchants is constructed according to the merchant information contained in the merchant data and the correlation degree relationship between the merchants. Specifically, each merchant can be regarded as a node of the graph structure data, a plurality of merchant nodes are generated, and then the plurality of merchant nodes are connected by edges according to the correlation degree relationship between the merchants, and thus the graph structure data between the merchants is obtained.

[0154] Step 303: Input the graph structure data into a graph neural network to obtain a plurality of output merchant node vectors.

[0155] Wherein, after the graph structure data between the merchants is constructed, the graph structure data is input into a graph neural network to obtain a merchant node vector corresponding to each merchant node obtained after convolution processing of the graph neural network.

[0156] In some embodiments, a graph embedding method can also be used to embed the graph structure data to obtain a merchant node vector corresponding to each merchant node.

[0157] In step 304, the plurality of merchant node vectors are input into a preset first model to classify the merchants in a preset scenario.

[0158] Wherein, after obtaining the merchant node vector corresponding to each merchant, the merchant node vector corresponding to each merchant is input into a preset first model for classification to obtain a classification result of the merchant classification. When there is only one merchant data in the merchant data set, a graph embedding method can also be used to generate a merchant node vector corresponding to the merchant, and then the merchant node vector is input into the preset first model to obtain a classification result. Wherein the preset first model here is Figure 2 The classification model trained in the embodiment, wherein it can be understood that the current classification scenario of the merchant is the same as Figure 2 The scenario for training the classification model in the embodiment is the same.

[0159] In some embodiments, the merchant classification method provided in the present application further comprises:

[0160] 1. Obtain statistical feature data of each merchant;

[0161] 2. Process the merchant node vector corresponding to each merchant through a preset first model to obtain a first feature vector corresponding to each merchant;

[0162] 3. Extract features of the statistical feature data of each merchant through a preset second model to obtain a second feature vector corresponding to each merchant;

[0163] 4. Fuse the first feature vector and the second feature vector of each merchant to obtain a fusion vector of each merchant;

[0164] 5. Input the fusion vector of each merchant into a preset third model to classify the merchants.

[0165] In the embodiment of the present application, the preset first model is Figure 3 The first multi-layer perceptron in the embodiment, the preset second model is Figure 3 The second multi-layer perceptron in the embodiment, and the preset third model is Figure 3The logic regression model in the embodiment. After obtaining the merchant data set, the statistical features of each merchant and the graph features of the merchant, i.e., the merchant node vector of the merchant, are determined according to the merchant data set. Then, the preset first model is used to extract features from the graph features of the merchant to obtain the first feature vector of the merchant, and the preset second model is used to extract features from the statistical features of the merchant to obtain the second feature vector of the merchant. The first feature vector of the merchant and the second feature vector of the merchant are fused to obtain the fusion vector of the merchant. Finally, the fusion vector of the merchant is input into the preset third model for classification to obtain the classification result.

[0166] According to the above description, the merchant classification method provided by the embodiment of the application can obtain a merchant data set, the merchant data set includes merchant information of a plurality of merchants and an association degree relationship between the merchants; a graph structure data between the merchants is constructed according to the merchant information of the plurality of merchants and the association degree relationship between the merchants; the graph structure data is input into a graph neural network to obtain a plurality of merchant node vectors output; and the plurality of merchant node vectors are input into a preset first model to classify the plurality of merchants in a preset scene, the preset model is Figure 2 The classification model trained in the embodiment. Since Figure 2 The classification model trained in the embodiment is a model trained based on the graph features of the merchant. The model is trained using the association degree relationship between the merchants, and the classification result is more accurate. Therefore, the graph features of the merchant are extracted by the graph neural network, and then input into the trained classification model for classification, which can improve the accuracy of the classification result of the merchant classification.

[0167] In order to better implement the above method, the embodiment of the application further provides a model training device, which can be integrated in a terminal or a server.

[0168] For example, as Figure 6 shown, the model training device provided by the embodiment of the application has a structure schematic diagram, which can include a first acquisition unit 401, a first construction unit 402, a first input unit 403, a second acquisition unit 404, and a first training unit 405, as follows:

[0169] The first acquisition unit 401 acquires a training sample set, and the training sample set includes sample data and an association degree relationship between the sample data;

[0170] The first construction unit 402 is configured to construct graph structure data between the sample data according to the sample data and the association degree relationship between the sample data, and the graph structure data includes sample nodes converted from the sample data and edge relationship data between the sample nodes;

[0171] The first input unit 403 is configured to input the graph structure data into the graph neural network to obtain a plurality of sample node vectors outputted.

[0172] The second acquisition unit 404 is configured to acquire label information of each sample data under a preset scene.

[0173] The first training unit 405 is configured to train the first preset model by using the plurality of sample node vectors and the label information corresponding to each sample node vector, to obtain a trained first preset model.

[0174] In some embodiments, the model training apparatus provided in the present application further comprises:

[0175] The third acquisition unit is configured to acquire statistical feature data of each sample data.

[0176] The second training unit is configured to train the second preset model by using the statistical feature data of each sample data and the label information of each sample data under the preset scene, to obtain a trained second preset model.

[0177] The third training unit is configured to train the preset classification model based on the output of the trained first preset model and the output of the trained second preset model, to obtain a trained preset classification model.

[0178] In some embodiments, the third training unit comprises:

[0179] The first extraction subunit is configured to perform feature extraction on each sample data by using the trained first preset model, to obtain a first feature vector.

[0180] The second extraction subunit is configured to perform feature extraction on each sample data by using the trained second preset model, to obtain a second feature vector.

[0181] The fusion subunit is configured to correspondingly fuse the first feature vector and the second feature vector according to the sample data dimension, to obtain a fusion vector corresponding to each sample data.

[0182] The training subunit is configured to train the preset classification model by using the fusion vector corresponding to each sample data and the label information of each sample data under the preset scene, to obtain a trained classification model.

[0183] In some embodiments, the construction unit comprises:

[0184] The generation subunit is configured to generate a plurality of sample nodes by taking the sample data in the sample data set as nodes.

[0185] The connection subunit is configured to connect edges between sample nodes whose association degree relationship satisfies a preset condition, to obtain graph structure data between the sample data.

[0186] In some embodiments, the connecting unit comprises:

[0187] The computing module is configured to calculate spatial distance information between each sample node.

[0188] The connecting module is configured to connect edges between sample nodes with spatial distance information less than a preset threshold.

[0189] In some embodiments, the input unit comprises:

[0190] The obtaining sub-unit is configured to obtain graph structure type information of the graph structure data.

[0191] The determining sub-unit is configured to determine a target graph embedding method corresponding to each graph structure type information.

[0192] The processing sub-unit is configured to process the graph structure data of the corresponding graph structure type information based on the target graph embedding method, to obtain a sample node vector corresponding to each sample node in the graph structure data.

[0193] In some embodiments, the first training unit is further configured to:

[0194] Train the preset multi-layer perceptron using the plurality of sample node vectors and the label information corresponding to each sample node vector, to obtain the trained preset multi-layer perceptron.

[0195] In specific implementation, each unit above can be implemented as an independent entity, or can be combined as the same or several entities, and the specific implementation of each unit above can be referred to the method embodiments above, which will not be described herein.

[0196] From the above, the model training device provided by the embodiment can obtain a training sample set through the first obtaining unit 401, and the training sample set includes sample data and a correlation degree relationship between the sample data. The first constructing unit 402 constructs graph structure data between the sample data according to the sample data and the correlation degree relationship between the sample data. The graph structure data includes sample nodes converted from the sample data and edge relationship data between the sample nodes. The first input unit 403 inputs the graph structure data into a graph neural network to obtain a plurality of sample node vectors output by the graph neural network. The second obtaining unit 404 obtains label information of each sample node vector in a preset scene. The first training unit 405 trains a first preset model by using the plurality of sample node vectors and the label information corresponding to each sample node vector, and obtains a trained first preset model. In this way, the graph structure data is generated according to the correlation degree relationship between the sample data, and then the feature vector of each sample is extracted from the graph structure data for model training. The method uses the correlation degree relationship between the samples for enhanced training, improves the model training effect, and improves the accuracy of model processing.

[0197] To better implement the above method, the embodiment of the application further provides a merchant classification device, which can be integrated in a terminal or a server.

[0198] For example, as shown in Figure 7 Fig. 1 is a structural schematic diagram of a merchant classification device provided by an embodiment of the application. The merchant classification device can include a fourth obtaining unit 501, a second constructing unit 502, a second input unit 503, and a first classification unit 504, as follows:

[0199] The fourth obtaining unit 501 is configured to obtain a merchant data set, and the merchant data set includes merchant information of a plurality of merchants and a correlation degree relationship between the merchants.

[0200] The second constructing unit 502 is configured to construct graph structure data between the merchants according to the merchant information of the plurality of merchants and the correlation degree relationship between the merchants.

[0201] The second input unit 503 is configured to input the graph structure data into a graph neural network to obtain a plurality of merchant node vectors output by the graph neural network.

[0202] The first classification unit 504 is configured to input the plurality of merchant node vectors into a preset first model to classify the plurality of merchants in a preset scene. The preset model is a trained classification model provided in the embodiment. Figure 2

[0203] In some embodiments, the merchant classification device provided by the application further includes:

[0204] The second obtaining unit is configured to obtain statistical feature data of each merchant.​

[0205] a processing unit, configured to process the merchant node vector corresponding to each merchant by a preset first model to obtain a first feature vector corresponding to each merchant, the preset first model being Figure 3 the trained first multilayer perceptron provided in the embodiment;

[0206] an extraction unit, configured to perform feature extraction on the statistical feature data of each merchant by a preset second model to obtain a second feature vector corresponding to each merchant, the preset second model being Figure 3 the trained second multilayer perceptron provided in the embodiment;

[0207] a fusion unit, configured to fuse the first feature vector and the second feature vector of each merchant to obtain a fusion vector of each merchant;

[0208] a second classification unit, configured to input the fusion vector of each merchant into a preset third model to classify the merchants, the preset third model being Figure 3 the trained logistic regression model provided in the embodiment.

[0209] In specific implementation, each of the units can be implemented as an independent entity, or can be combined as the same or several entities, and the specific implementation of each of the units can be referred to the method embodiment above, which will not be described here.

[0210] According to the above description, the merchant classification method provided in the embodiment of the present application can obtain a merchant data set by the fourth acquisition unit 501, the merchant data set contains merchant information of a plurality of merchants and an association degree relationship between the merchants; the second construction unit 502 constructs graph structure data between the merchants according to the merchant information of the plurality of merchants and the association degree relationship between the merchants; the second input unit 503 inputs the graph structure data into a graph neural network to obtain output of a plurality of merchant node vectors; the first classification unit 504 inputs the plurality of merchant node vectors into a preset first model to classify the plurality of merchants in a preset scene, the preset model being Figure 2 the trained classification model in the embodiment. Since Figure 2 The trained classification model in the embodiment is a model trained based on graph features of the merchants, which is trained by using the association degree relationship between the merchants, and the classification result is more accurate, so that the graph features of the merchants are extracted by the graph neural network, and then input into the trained classification model for classification, which can improve the accuracy of the classification result of the merchant classification.

[0211] The embodiment of the present application also provides a computer device, which can be a terminal or a server, such as Figure 8The figure shows the structure of the computer device provided by this application. Specifically:

[0212] The computer device may include one or more processing core processors 601, one or more storage media memories 602, a power supply 603, an input unit 604 and other components. Those skilled in the art will understand that Figure 8 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently.

[0213] Processor 601 is the control center of the computer device. It connects the various components of the entire computer device using various interfaces and lines. By running or executing software programs and / or modules stored in memory 602 and accessing data stored in memory 602, it performs various functions of the computer device and processes data, thereby performing overall testing of the computer device. Optionally, processor 601 may include one or more processing cores; preferably, processor 601 may integrate an application processor and a modem processor, wherein the application processor primarily processes the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 601.

[0214] The memory 602 can be used to store software programs and modules, and the processor 601 executes various functional applications and model training by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, and web page access, etc.); the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.

[0215] The computer device also includes a power supply 603 for supplying power to various components. Preferably, the power supply 603 can be logically connected to the processor 601 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The power supply 603 can also include one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and other arbitrary components.

[0216] The computer device can also include an input unit 604, which can be used to receive inputted digital or character information, and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.

[0217] Although not shown, the computer device can also include a display unit and the like, which will not be described here. In particular in the present embodiment, the processor 601 in the computer device will load one or more executable files corresponding to processes of one or more application programs into the memory 602 according to the following instructions, and run the application programs stored in the memory 602 by the processor 601, thereby implementing various functions as follows:

[0218] Obtain a training sample set, the training sample set including sample data and a correlation degree relationship between the sample data; construct a graph structure data between the sample data according to the sample data and the correlation degree relationship between the sample data, the graph structure data including sample nodes converted from the sample data and edge relationship data between the sample nodes; input the graph structure data into a graph neural network to obtain a plurality of output sample node vectors; obtain label information of each sample node vector in a preset scene; train a first preset model using the plurality of sample node vectors and the label information corresponding to each sample node vector to obtain a trained first preset model.

[0219] Alternatively, obtain a merchant data set, the merchant data set including merchant information of a plurality of merchants and a correlation degree relationship between the merchants; construct a graph structure data between the merchants according to the merchant information of the plurality of merchants and the correlation degree relationship between the merchants; input the graph structure data into a graph neural network to obtain a plurality of output merchant node vectors; input the plurality of merchant node vectors into a preset first model to classify the plurality of merchants in a preset scene, the preset model being Figure 2 a trained classification model in the embodiment.

[0220] It should be noted that the computer device provided by the embodiments of the present application and the method in the above embodiments belong to the same concept, and the specific implementation of each operation can be referred to the previous embodiments, which will not be described here.

[0221] Those skilled in the art can understand that all or part of the steps of the various methods of the above embodiments can be completed by instructions, or by related hardware controlled by the instructions, which can be stored in a computer readable storage medium and loaded and executed by a processor.

[0222] Therefore, the embodiments of the present application provide a computer readable storage medium, which stores a plurality of instructions. The instructions can be loaded by a processor to execute the steps in any method provided by the embodiments of the present application. For example, the instructions can execute the following steps:

[0223] obtain a training sample set, the training sample set comprising sample data and a correlation relationship between the sample data; construct graph structure data between the sample data according to the sample data and the correlation relationship between the sample data, the graph structure data comprising sample nodes converted from the sample data and edge relationship data between the sample nodes; input the graph structure data into a graph neural network to obtain a plurality of sample node vectors output; obtain label information of each sample node vector in a preset scenario; train a first preset model using the plurality of sample node vectors and the label information corresponding to each sample node vector to obtain a trained first preset model.

[0224] Alternatively, obtain a merchant data set, the merchant data set comprising merchant information of a plurality of merchants and a correlation relationship between the merchants; construct graph structure data between the merchants according to the merchant information of the plurality of merchants and the correlation relationship between the merchants; input the graph structure data into a graph neural network to obtain a plurality of merchant node vectors output; input the plurality of merchant node vectors into a preset first model to classify the plurality of merchants in a preset scenario, the preset model being Figure 2 the classification model trained in the embodiment.

[0225] The specific implementation of each operation can refer to the foregoing embodiments, which will not be described here.

[0226] The computer readable storage medium can include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0227] Due to the instructions stored in the computer readable storage medium, the steps in any of the methods provided in the embodiments of the application can be performed, and thus the beneficial effects of any of the methods provided in the embodiments of the application can be achieved. Details are described in the foregoing embodiments, which will not be described here.

[0228] According to an aspect of the present application, a computer program product or computer program is provided, which includes computer instructions stored in a storage medium. The processor of the computer device reads the computer instructions from the storage medium, and the processor executes the computer instructions to enable the computer device to perform the method provided in any of the various optional implementation manners of the above Figure 2 , Figure 3 or Figure 5 .

[0229] The model training method and the merchant classification method and device provided by the embodiments of the present application are described in detail above, and the principles and implementation manners of the present application are described by applying specific examples. The above description of the embodiments is only used to help understand the method of the present application and its core idea. Meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manners and application ranges will be changed, and the above description of the present application should not be understood as a limitation.

Claims

1. A model training method, characterized in that: The method comprises: Acquire a training sample set, wherein the training sample set includes sample data and correlation relationships between the sample data, wherein the sample data and the correlation relationships between the sample data are merchant information of multiple merchants and correlation relationships between the merchants; Constructing graph structure data between the sample data based on the sample data and the correlation relationship between the sample data, wherein the graph structure data includes sample nodes converted from the sample data and edge relationship data between the sample nodes, the sample nodes represent merchants, and the edge relationships between the sample nodes represent the correlation relationships between the merchants; Inputting the graph structure data into a graph neural network to obtain multiple sample node vectors as output; Obtain label information for each sample data in a preset scenario; Using the plurality of sample node vectors and the label information corresponding to each sample node vector to train a first preset model to obtain a trained first preset model; Obtain statistical characteristic data of each sample data; Using the statistical feature data of each sample data and the label information of each sample data in the preset scenario to train a second preset model to obtain a trained second preset model; Perform feature extraction on each sample data using the trained first preset model to obtain a first feature vector; Perform feature extraction on each sample data using the trained second preset model to obtain a second feature vector; Fusing the first eigenvector and the second eigenvector according to the sample data dimension to obtain a fusion vector corresponding to each sample data; The preset classification model is trained using the fusion vector corresponding to each sample data and the label information of each sample data in the preset scenario to obtain a trained classification model. The trained classification model is suitable for merchant classification in the preset scenario.

2. The method according to claim 1, characterized in that The step of constructing graph structure data between the sample data according to the sample data and the correlation relationship between the sample data includes: Using the sample data in the training sample set as nodes to generate multiple sample nodes; The sample nodes whose correlation relations meet the preset conditions are connected by edges to obtain the graph structure data between the sample data.

3. The method according to claim 2, characterized in that The step of connecting sample nodes whose correlations satisfy preset conditions with edges includes: Calculate the spatial distance information between each sample node; The sample nodes whose spatial distance information is less than a preset threshold are connected by edges.

4. The method according to claim 1, wherein The step of inputting the graph structure data into a graph neural network to obtain multiple sample node vectors as output includes: Obtaining graph structure type information of the graph structure data; Determine the target graph embedding method corresponding to each graph structure type information; The graph structure data of the corresponding graph structure type information is processed based on the target graph embedding method to obtain a sample node vector corresponding to each sample node in the graph structure data.

5. The method according to claim 1, wherein The step of training a first preset model using the plurality of sample node vectors and the label information corresponding to each sample node vector to obtain a trained first preset model includes: The plurality of sample node vectors and the label information corresponding to each sample node vector are used to train a preset multi-layer perceptron to obtain a trained preset multi-layer perceptron.

6. A merchant classification method, characterized in that: The method comprises: Acquire a merchant data set, wherein the merchant data set includes merchant information of multiple merchants and correlation relationships between merchants; Constructing graph structure data between merchants based on the merchant information of the plurality of merchants and the correlation relationship between the merchants; Inputting the graph structure data into a graph neural network to obtain multiple merchant node vectors as output; Inputting the plurality of merchant node vectors into a preset first model to classify the plurality of merchants under a preset scenario, wherein the preset first model is the trained first preset model according to any one of claims 1 to 5; Obtain statistical characteristic data of each merchant; Processing the merchant node vector corresponding to each merchant using the preset first model to obtain a first feature vector corresponding to each merchant; Extracting features from the statistical feature data of each merchant using a preset second model to obtain a second feature vector corresponding to each merchant, wherein the preset second model is the trained second preset model described in claim 1; Fusing the first eigenvector and the second eigenvector of each merchant to obtain a fusion vector of each merchant; The fusion vector of each merchant is input into a preset third model to classify the merchants. The preset third model is the trained classification model described in claim 1.

7. A model training device, characterized in that: The device comprises: A first acquisition unit acquires a training sample set, wherein the training sample set includes sample data and correlation relationships between the sample data, wherein the sample data and the correlation relationships between the sample data are merchant information of multiple merchants and correlation relationships between the merchants; A first construction unit is configured to construct graph structure data between the sample data based on the sample data and the association relationship between the sample data, wherein the graph structure data includes sample nodes converted from the sample data and edge relationship data between the sample nodes, the sample nodes represent merchants, and the edge relationships between the sample nodes represent the association relationships between the merchants; A first input unit is used to input the graph structure data into the graph neural network to obtain a plurality of sample node vectors as output; A second acquiring unit is used to acquire label information of each sample data in a preset scenario; A first training unit is configured to train a first preset model using the plurality of sample node vectors and label information corresponding to each sample node vector to obtain a trained first preset model; a third acquiring unit, configured to acquire statistical characteristic data of each sample data; A second training unit is configured to train a second preset model using the statistical feature data of each sample data and the label information of each sample data in the preset scenario to obtain a trained second preset model; A third training unit is configured to extract features from each sample data using the trained first preset model to obtain a first feature vector; Perform feature extraction on each sample data using the trained second preset model to obtain a second feature vector; Fusing the first eigenvector and the second eigenvector according to the sample data dimension to obtain a fusion vector corresponding to each sample data; The preset classification model is trained using the fusion vector corresponding to each sample data and the label information of each sample data in the preset scenario to obtain a trained classification model. The trained classification model is suitable for merchant classification in the preset scenario.

8. A merchant classification device, characterized in that: The device comprises: a fourth acquiring unit, configured to acquire a merchant data set, wherein the merchant data set includes merchant information of a plurality of merchants and correlation relationships between the merchants; A second construction unit is configured to construct graph structure data between merchants based on the merchant information of the plurality of merchants and the correlation relationships between the merchants; A second input unit is used to input the graph structure data into the graph neural network to obtain multiple merchant node vectors as output; a first classification unit, configured to input the plurality of merchant node vectors into a preset first model to classify the plurality of merchants under a preset scenario, wherein the preset first model is the trained first preset model according to any one of claims 1 to 5; A second acquiring unit is used to acquire statistical characteristic data of each merchant; a processing unit, configured to process the merchant node vector corresponding to each merchant using the preset first model to obtain a first feature vector corresponding to each merchant; an extraction unit, configured to extract features from the statistical feature data of each merchant using a preset second model to obtain a second feature vector corresponding to each merchant, wherein the preset second model is the trained second preset model according to claim 1; a fusion unit, configured to fuse the first feature vector and the second feature vector of each merchant to obtain a fusion vector of each merchant; The second classification unit is used to input the fusion vector of each merchant into a preset third model to classify the merchants, and the preset third model is the trained classification model described in claim 1.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a plurality of instructions, which are suitable for loading by a processor to execute the steps of the model training method described in any one of claims 1 to 5 or the steps of the merchant classification method described in claim 6.

10. A computer device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the model training method according to any one of claims 1 to 5 or the steps of the merchant classification method according to claim 6 when executing the computer program.

11. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a storage medium. The processor of a computer device reads the computer instructions from the storage medium, and the processor executes the computer instructions, so that the computer device executes the steps of the model training method described in any one of claims 1 to 5 or the steps of the merchant classification method described in claim 6.

Citation Information

Patent Citations

  • Training method of user classification model and information pushing method

    CN111461299A