CN-116720589-B - Model processing method, device and equipment
Abstract
The embodiment of the specification discloses a method, a device and equipment for processing a model, wherein the method comprises the steps of constructing a semantic tree aiming at a target service, constructing a service map corresponding to the target service based on the semantic tree, wherein the service map consists of nodes and edges, acquiring historical service data generated in the target service, determining a first service sub-graph corresponding to the historical service data based on the historical service data, generating a second service sub-graph based on the first service sub-graph through a preset data enhancement rule, and using the first service sub-graph and the second service sub-graph as sub-graphs respectively contained in the service map based on the service map corresponding to the target service, and performing model training on a graph structure model through a comparison learning mode based on each service sub-graph in the first service sub-graph and the second service sub-graph respectively compared with each service sub-graph to obtain a trained graph structure model.
Inventors
- XU XIAOLONG
- LIU TENGFEI
- ZHANG TIANYI
- WANG WEIQIANG
Assignees
- 支付宝(杭州)信息技术有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20230529
Claims (8)
- 1. A method of processing a model, the method comprising: Constructing a semantic tree aiming at a target service, and constructing a service map corresponding to the target service based on the semantic tree, wherein the service map consists of nodes and edges, and the target service is a risk identification service aiming at online transactions; Acquiring historical service data generated in the target service, determining a first service subgraph corresponding to the historical service data based on the historical service data, and generating a second service subgraph based on the first service subgraph through a preset data enhancement rule, wherein the first service subgraph and the second service subgraph are subgraph respectively contained in the service map, and the historical service data comprise account numbers, transaction places, transaction time, transaction amounts, commodity information of transactions and commodity handover modes of both transaction parties; Based on a service map corresponding to the target service, a first service sub-graph and a second service sub-graph corresponding to the historical service data are used, a graph structure model is trained by adopting a preset loss function of a comparison learning mode through the comparison learning mode based on the comparison of each service sub-graph in the first service sub-graph and each service sub-graph with each service sub-graph, the trained graph structure model is obtained, the preset loss function is constructed based on the first service sub-graph, the second service sub-graph, the first service sub-graph and the second service sub-graph, and a preset hyper-parameter and a similarity matrix based on the comparison of each service sub-graph in the first service sub-graph and each service sub-graph with each service sub-graph, the preset loss function comprises InfoNCE loss functions, and N values arranged in the similarity matrix in front are introduced into a denominator of a InfoNCE loss function in the form of a multiplication coefficient.
- 2. The method of claim 1, the graph structure model being a model constructed from a graph neural network and a multi-layer perceptron.
- 3. The method of claim 2, the data enhancement rules comprising one or more of rules for flipping the first business subgraph, shifting nodes in the first business subgraph, clipping nodes and/or edges in the first business subgraph, and morphing the first business subgraph.
- 4. The method of claim 1, the similarity matrix being a matrix constructed from similarities greater than a similarity threshold among similarities based on each of the first and second business subgraphs being compared with the each business subgraph, respectively.
- 5. The method of claim 4, wherein the target business is a risk prevention business of a transaction, and the graph structure model is used for risk identification of a specific transaction currently performed or is used for identifying an account with a preset risk in a historical transaction.
- 6. The method of claim 5, the method further comprising: acquiring historical transaction data generated in a preset period; Determining a target business subgraph corresponding to the historical transaction data based on the historical transaction data, wherein the target business subgraph comprises nodes constructed by account information and edges constructed by transaction relations among different accounts; And inputting the target business subgraph into a trained graph structure model to obtain an account with preset risk in the historical transaction data.
- 7. A device for processing a model, the device comprising: The system comprises a map construction module, a target service identification module and a target service identification module, wherein the map construction module is used for constructing a semantic tree aiming at a target service, constructing a service map corresponding to the target service based on the semantic tree, wherein the service map consists of nodes and edges, and the target service is a risk identification service aiming at online transactions; The sub-graph construction module is used for acquiring historical service data generated in the target service, determining a first service sub-graph corresponding to the historical service data based on the historical service data, and generating a second service sub-graph based on the first service sub-graph through a preset data enhancement rule, wherein the first service sub-graph and the second service sub-graph are sub-graphs respectively contained in the service graph, and the historical service data comprise account numbers, transaction places, transaction time, transaction amounts, commodity information of transactions and commodity handover modes of both transaction parties; The model training module is used for carrying out model training on the graph structure model by adopting a preset loss function of a comparison learning mode based on a comparison learning mode that each business sub-graph in the first business sub-graph and the second business sub-graph is respectively compared with each business sub-graph based on a business graph corresponding to the target business, so as to obtain a trained graph structure model, wherein the preset loss function is constructed based on the first business sub-graph, the second business sub-graph, the first business sub-graph and the second business sub-graph, and a preset hyper-parameter and a similarity matrix based on the comparison of each business sub-graph in the first business sub-graph and the second business sub-graph with each business sub-graph, the preset loss function comprises InfoNCE loss functions, and N values arranged in the similarity matrix in front are introduced into a coefficient of InfoNCE loss functions in a form of multiplication coefficients.
- 8. A processing apparatus of a model, the processing apparatus of the model comprising: processor, and A memory arranged to store computer executable instructions that, when executed, cause the processor to: Constructing a semantic tree aiming at a target service, and constructing a service map corresponding to the target service based on the semantic tree, wherein the service map consists of nodes and edges, and the target service is a risk identification service aiming at online transactions; Acquiring historical service data generated in the target service, determining a first service subgraph corresponding to the historical service data based on the historical service data, and generating a second service subgraph based on the first service subgraph through a preset data enhancement rule, wherein the first service subgraph and the second service subgraph are subgraph respectively contained in the service map, and the historical service data comprise account numbers, transaction places, transaction time, transaction amounts, commodity information of transactions and commodity handover modes of both transaction parties; Based on a service map corresponding to the target service, a first service sub-graph and a second service sub-graph corresponding to the historical service data are used, a graph structure model is trained by adopting a preset loss function of a comparison learning mode through the comparison learning mode based on the comparison of each service sub-graph in the first service sub-graph and each service sub-graph with each service sub-graph, the trained graph structure model is obtained, the preset loss function is constructed based on the first service sub-graph, the second service sub-graph, the first service sub-graph and the second service sub-graph, and a preset hyper-parameter and a similarity matrix based on the comparison of each service sub-graph in the first service sub-graph and each service sub-graph with each service sub-graph, the preset loss function comprises InfoNCE loss functions, and N values arranged in the similarity matrix in front are introduced into a denominator of a InfoNCE loss function in the form of a multiplication coefficient.
Description
Model processing method, device and equipment Technical Field The present document relates to the field of computer technologies, and in particular, to a method, an apparatus, and a device for processing a model. Background Along with the continuous enrichment of data, a large amount of data are stored in the form of graph structure data, and the graph structure data has the storage advantage that the relation among the data can be highlighted more, so that the data dimension is enriched, the high-level effective characteristics can be mined, and meanwhile, even if a large amount of data exist, the data are mainly unlabeled data, so that the characteristics of the data are acquired through deep learning model training, and more convenient support is provided for downstream tasks. At the same time, there are often multiple downstream tasks in the same piece of data, and if each task needs to train a deep learning model, larger consumption of computing resources is caused. Therefore, the contrast learning can be effectively used as an upstream task to extract features, and especially for graph structure data, unlike other images and NLP tasks, the graph structure data not only contains the attribute features of the nodes, but also contains rich relationship data, and how to consider the factors in the contrast learning mechanism is challenging. Therefore, a better contrast learning technical scheme based on semantic information is needed to be provided, so that the performance of contrast learning can be improved. Disclosure of Invention The embodiment of the specification aims to provide a better contrast learning technical scheme based on semantic information, so that the performance of contrast learning can be improved. In order to achieve the above technical solution, the embodiments of the present specification are implemented as follows: The method for processing the model comprises the steps of constructing a semantic tree aiming at a target service, and constructing a service map corresponding to the target service based on the semantic tree, wherein the service map consists of nodes and edges. Acquiring historical service data generated in the target service, determining a first service subgraph corresponding to the historical service data based on the historical service data, and generating a second service subgraph based on the first service subgraph through a preset data enhancement rule, wherein the first service subgraph and the second service subgraph are subgraphs respectively contained in the service atlas. And based on the service map corresponding to the target service, using a first service subgraph and a second service subgraph corresponding to the historical service data, and performing model training on the graph structure model by a comparison learning mode based on that each service subgraph in the first service subgraph and the second service subgraph is respectively compared with each service subgraph, so as to obtain a trained graph structure model. The device for processing the model comprises a map construction module, a semantic tree construction module and a model processing module, wherein the semantic tree construction module is used for constructing a service map corresponding to a target service based on the semantic tree, and the service map is composed of nodes and edges. The sub-graph construction module is used for acquiring historical service data generated in the target service, determining a first service sub-graph corresponding to the historical service data based on the historical service data, and generating a second service sub-graph based on the first service sub-graph through a preset data enhancement rule, wherein the first service sub-graph and the second service sub-graph are sub-graphs respectively contained in the service graph. The model training module is used for carrying out model training on the graph structure model by using a first service subgraph and a second service subgraph corresponding to the historical service data based on the service map corresponding to the target service and carrying out model training on the graph structure model by a comparison learning mode based on that each service subgraph in the first service subgraph and the second service subgraph is respectively compared with each service subgraph, so as to obtain a trained graph structure model. The embodiment of the specification provides a processing device of a model, which comprises a processor and a memory arranged to store computer executable instructions, which when executed, cause the processor to construct a semantic tree for a target service, construct a service graph corresponding to the target service based on the semantic tree, the service graph being composed of nodes and edges. Acquiring historical service data generated in the target service, determining a first service subgraph corresponding to the historical service data based on the historical service data, a