Data processing method, device, equipment and storage medium in graph neural network
By decoupling and updating the relationship triplets of the graph neural network as embedded components, the deviation problem of graph neural network in dynamic data processing is solved, continuous learning and knowledge retention are achieved, and the effect of data processing is improved.
Patent Information
- Application Number
- CN202010915884.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-03
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2040-09-03
AI Technical Summary
The existing graph neural networks have large deviations when processing dynamic data, and cannot effectively adapt to the real-time changes in data in the real world, affecting the user experience.
By decoupling the relationship triplets of the first graph neural network into multiple embedded components, the graph embedding is determined based on the embedded components, and the update process is triggered to form the second graph neural network, maintaining initial knowledge and adapting to dynamic data.
The graph neural network continuously learns dynamic data, improves the richness and forward-looking nature of data processing, and improves the user experience.
Smart Images

Figure CN112257841B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to information processing technology, and in particular to data processing methods, devices, equipment and storage media in graph neural networks. Background Art
[0002] Artificial Intelligence (AI) is a comprehensive field in computer science. By studying the design principles and implementation methods of various intelligent machines, it aims to enable them to possess the capabilities of perception, reasoning, and decision-making. AI technology is an interdisciplinary discipline encompassing a wide range of fields, including natural language processing and machine learning / deep learning. With technological advancement, AI will be applied in even more areas and play an increasingly important role.
[0003] Graph neural networks in related technologies often use fixed training modes for model training, ignoring the fact that data in the real world is constantly increasing (data changes in real time). This causes the data processing results of graph neural networks in practical applications to often have large deviations, affecting user usage. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a data processing method, device, server, and storage medium in a graph neural network. The technical solution of the embodiments of the present invention is implemented as follows:
[0005] An embodiment of the present invention provides a data processing method in a graph neural network, the method comprising:
[0006] Obtaining the initial structure of the first graph neural network and the data to be processed in the data stream;
[0007] In response to the acquired data to be processed, triggering a decoupling process and decoupling the relation triples in the first graph neural network into a plurality of embedding components;
[0008] Determining graph embeddings corresponding to different embedding components based on different embedding components matched with the relation triples in the first graph neural network;
[0009] Based on the corresponding graph embedding results, an update process is triggered to update the relationship triplets in the initial structure of the first graph neural network to form a second graph neural network.
[0010] An embodiment of the present invention further provides a data processing device in a graph neural network, the device comprising:
[0011] An information transmission module, used to obtain the initial structure of the first graph neural network and the data to be processed in the data stream;
[0012] an information processing module, configured to trigger a decoupling process and decouple the relation triples in the first graph neural network into a plurality of embedding components in response to the acquired data to be processed;
[0013] The information processing module is configured to determine graph embeddings corresponding to different embedding components based on different embedding components that match the relation triples in the first graph neural network;
[0014] The information processing module is used to trigger an update process based on the corresponding graph embedding results to update the relationship triples in the initial structure of the first graph neural network to form a second graph neural network.
[0015] In the above scheme,
[0016] The information processing module is configured to determine an edge information set and a node information set in the first graph neural network based on a usage environment of the first graph neural network;
[0017] The information processing module is configured to determine, based on the edge information set and the node information set, a relationship triple in the initial structure of the first graph neural network;
[0018] The information processing module is used to parse different types of data in the data stream based on the usage environment of the first graph neural network, and determine the data to be processed that matches the usage environment of the first graph neural network.
[0019] In the above scheme,
[0020] The information processing module is configured to determine, based on the semantic features of the nodes in the relationship triples, a set of independent components that matches the node vector information in the relationship triples in the first graph neural network;
[0021] The information processing module is used to decouple the relation triples in the first graph neural network based on a set of independent components that match the node vector information in the relation triples, so as to form different embedding components that match the triples.
[0022] In the above scheme,
[0023] The information processing module is configured to determine attention parameters that match relation triplets in the first graph neural network when the first graph neural network is a knowledge graph.
[0024] The information processing module is used to normalize the attention parameters matching the relationship triples, so as to achieve the representation of the degree of association between the edge information in the relationship triples and the corresponding embedded components through the attention parameters.
[0025] In the above scheme,
[0026] The information processing module is configured to determine at least two embedding components based on node parameters in the relationship triples and perform serial processing when the first graph neural network is based on a reconstructed knowledge graph;
[0027] The information processing module is used to perform normalization processing based on the result of the series processing to determine the graph embeddings corresponding to different embedding components.
[0028] In the above scheme,
[0029] The information processing module is configured to determine at least two embedded components and perform component splicing processing based on node parameters in the relationship triples when the first graph neural network is a bilinear-based knowledge graph;
[0030] The information processing module is used to perform convolution processing based on the result of the splicing processing to determine the graph embeddings corresponding to different embedding components.
[0031] In the above scheme,
[0032] The information processing module is configured to determine a parameter concatenation result with a relation triple in the first graph neural network when the first graph neural network is an information network;
[0033] The information processing module is used to perform linear change processing on the parameter splicing result in the relation triple to form corresponding attention parameters matching the relation triple;
[0034] The information processing module is used to normalize the attention parameters matching the relationship triples, so as to achieve the representation of the degree of association between the edge information in the relationship triples and the corresponding embedded components through the attention parameters.
[0035] In the above scheme,
[0036] The information processing module is configured to determine, through the update process, association relationships between different relationship triplets in the initial structure of the first graph neural network;
[0037] The information processing module is configured to determine the relationship triples that need to be updated in the initial structure of the first graph neural network based on the association relationships between the different relationship triples;
[0038] The information processing module is used to keep part of the semantic information in the relationship triples that need to be updated unchanged, perform data processing on the relationship triples that need to be updated based on the data to be processed in the data stream, and form a second graph neural network to represent the semantic information of the data to be processed through the updated relationship triples.
[0039] In the above scheme,
[0040] The information processing module is used to determine a first loss function and a second loss function that match the second graph neural network;
[0041] The information processing module is used to determine a loss function that matches the second graph neural network based on the first loss function and the second loss function;
[0042] The information processing module is used to adjust the network parameters of the second graph neural network based on the loss function matching the second graph neural network;
[0043] The information processing module is used to process the data to be processed in different usage environments through the second graph neural network until the loss function of the second graph neural network reaches the corresponding convergence condition.
[0044] In the above scheme,
[0045] The information processing module is configured to, when the first graph neural network is a knowledge graph, determine corresponding invalid relationship triples as negative example samples based on the data to be processed in the data stream;
[0046] The information processing module is used to determine a first loss function and a second loss function that match the second graph neural network based on the negative example samples;
[0047] The information processing module is configured to determine the node labels and the number of node categories in the first graph neural network when the first graph neural network is an information network;
[0048] The information processing module is used to determine a first loss function and a second loss function that match the second graph neural network based on the node labels and the number of node categories in the first graph neural network.
[0049] In the above scheme,
[0050] The information processing module is used to determine a constraint loss function that matches the second graph neural network;
[0051] The information processing module is used to determine the weight hyperparameter of the regularization term corresponding to the constraint loss function;
[0052] The information processing module is used to determine the sum of the first loss function, the second loss function and the constraint loss function based on the weight hyperparameter of the regularization term corresponding to the constraint loss function, as the loss function matching the second graph neural network.
[0053] In the above scheme,
[0054] The information processing module is configured to, when the first graph neural network is a knowledge graph and the usage environment of the first graph neural network is question-answer information processing, determine, based on the corresponding question-answer information, a first knowledge graph corresponding to a target object in the question-answer information;
[0055] The information processing module is configured to determine, based on the target object, updated data in the network information that matches the target object;
[0056] The information processing module is used to decouple the first knowledge graph of the target object and update different relationship triples in the first knowledge graph based on the updated data to form a second knowledge graph, so as to respond to the question information received by the terminal through the second knowledge graph.
[0057] An embodiment of the present invention further provides an electronic device, comprising:
[0058] a memory for storing executable instructions;
[0059] The processor is used to implement the data processing method in the aforementioned graph neural network when running the executable instructions stored in the memory.
[0060] An embodiment of the present invention also provides a computer-readable storage medium storing executable instructions, which, when executed by a processor, implement the data processing method in the aforementioned graph neural network.
[0061] The embodiments of the present invention have the following beneficial effects:
[0062] The embodiment of the present invention obtains the initial structure of a first graph neural network and the data to be processed in the data stream; in response to the obtained data to be processed, triggers a decoupling process and decouples the relation triples in the first graph neural network into multiple embedding components; based on different embedding components that match the relation triples in the first graph neural network, determines the graph embeddings corresponding to the different embedding components; based on the corresponding graph embedding results, triggers an update process to update the relation triples in the initial structure of the first graph neural network to form a second graph neural network. In this way, the processing of dynamic data by the graph neural network is realized, and the continuous learning of the graph neural network can be realized in different data to form a new graph neural network, while retaining the knowledge already acquired by the initial graph neural network, thereby improving the richness and foresight of data processing and enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 A schematic diagram of a usage scenario of the data processing method in a graph neural network provided by an embodiment of the present invention;
[0064] Figure 2 A schematic diagram of the structure of a data processing device in a graph neural network provided by an embodiment of the present invention;
[0065] Figure 3 An optional flowchart of a data processing method in a graph neural network provided by an embodiment of the present invention;
[0066] Figure 4 A schematic diagram of establishing a knowledge graph in a data processing method in a graph neural network provided by an embodiment of the present invention;
[0067] Figure 5 This is a schematic diagram of the first graph neural network decoupling process in an embodiment of the present invention;
[0068] Figure 6 An optional flowchart of a data processing method in a graph neural network provided by an embodiment of the present invention;
[0069] Figure 7 Schematic diagram of the updating process of different relationship triples of the first graph neural network in an embodiment of the present invention;
[0070] Figure 8 Schematic diagram of the test effect of the data processing method in the neural network in an embodiment of the present invention;
[0071] Figure 9 Schematic diagram of the data processing application environment in the neural network according to an embodiment of the present invention;
[0072] Figure 10An optional flowchart of a data processing method in a graph neural network provided by an embodiment of the present invention;
[0073] Figure 11 A schematic diagram of implementing intelligent question answering using the data processing method in the graph neural network provided in this application;
[0074] Figure 12 This is a schematic diagram of the process of implementing financial information recommendation through the data processing method in the graph neural network in an embodiment of the present invention. DETAILED DESCRIPTION
[0075] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting the present invention. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0076] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0077] Before further explaining the embodiments of the present invention in detail, the nouns and terms involved in the embodiments of the present invention are explained. The nouns and terms involved in the embodiments of the present invention are subject to the following interpretations.
[0078] 1) In response, it is used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations can be executed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations are executed.
[0079] 2) Based on: It is used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed can be real-time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations executed are executed.
[0080] 3) Model training: Multi-classification learning is performed on image datasets. This model can be built using deep learning frameworks such as TensorFlow and Torch, using multiple layers of neural network layers such as CNN to form a multi-classification model. The model input is a three-channel or original channel matrix generated by reading the image using tools such as OpenCV. The model output is multi-classification probabilities, and finally outputs the webpage category through algorithms such as softmax. During training, the model approaches the correct trend using objective functions such as cross entropy.
[0081] 4) Neural Network (NN): Artificial Neural Network (ANN), also known as neural network or quasi-neural network, is a mathematical model or computational model that imitates the structure and function of biological neural networks (the central nervous system of animals, especially the brain) in the fields of machine learning and cognitive science. It is used to estimate or approximate functions.
[0082] 5) Graph Neural Network (GNN): A neural network that acts directly on graph structures, primarily processing data with non-Euclidean spatial structures (graph structures). It ignores the order of node input; during computation, the representation of a node is influenced by its surrounding neighboring nodes, while the connections of the graph itself remain unchanged; the representation of the graph structure enables graph-based reasoning. Typically, a graph neural network consists of two modules: a propagation module and an output module. The propagation module is used to transfer information between nodes in the graph and update the state, while the output module is used to define the objective function based on the vector representation of the nodes and edges of the graph, depending on the task. Graph neural networks include: Graph Convolutional Networks (GCNs), Gated Graph Neural Networks (GGNNs), and Graph Attention Networks (GAT) based on the attention mechanism.
[0083] 6) Directed graph: Represents the relationship between objects. A directed graph can be represented by an ordered triple (V(D), A(D), ψD), where ψD is the association function, which is an ordered pair of elements in V(D) corresponding to each element in A(D).
[0084] 7) Representation Learning: Also known as learning representations. In deep learning, representation refers to the form and method used to represent the model's input observations X through the model's parameters. Representation learning involves learning effective representations for observations X. Representation learning can take many forms, such as supervised training of CNN parameters, unsupervised pre-training of autoencoder and restricted Boltzmann machine parameters, and semi-supervised shared representation learning, which involves unsupervised pre-training followed by supervised fine-tuning of DBN parameters.
[0085] The data processing method in the graph neural network provided by the embodiment of the present invention is described below, wherein: Figure 1 Schematic diagram of the use scenario of the data processing method in the graph neural network provided by the embodiment of the present invention, see Figure 1 , the terminal (including terminal 10-1 and terminal 10-2) is provided with a client of software that can display corresponding different information, such as a client or plug-in for video playback. Users can obtain different information (such as different target videos or text news) and display it through the corresponding client; the terminal is connected to the server 200 through the network 300, and the corresponding trained graph neural network is deployed in the server 200 to recommend information. The network 300 can be a wide area network or a local area network, or a combination of the two, and a wireless link is used to realize data transmission. Of course, the data processing method in the graph neural network provided in the embodiment of the present invention can not only be applied to the use scenario of information recommendation, but also can be applied to link prediction under streaming data, dialogue systems, and various types of recommendation systems.
[0086] As an example, the server 200 is used to deploy a data processing device in a graph neural network to implement the data processing method in a graph neural network provided by the present invention, so as to obtain the initial structure of a first graph neural network and the data to be processed in the data stream; in response to the acquired data to be processed, trigger a decoupling process and decouple the relation triples in the first graph neural network into multiple embedding components; based on different embedding components matching the relation triples in the first graph neural network, determine the graph embeddings corresponding to the different embedding components; based on the corresponding graph embedding results, trigger an update process to update the relation triples in the initial structure of the first graph neural network to form a second graph neural network.
[0087] Of course, the data processing device within the graph neural network provided by the present invention can be applied to environments where virtual or physical resources are used for financial activities, or where physical financial resources are used for payment (including but not limited to recommendations for various types of physical financial resources), or where information is exchanged via social software. In these types of physical financial activities or payments via virtual resources, financial information from different data sources is typically processed via a graph neural network to enable recommendations for various types of physical financial resources. Ultimately, the user interface (UI) presents financial recommendation information corresponding to the target object selected by the target user. The financial information processed by the graph neural network (e.g., using the graph neural network to predict real-time stock prices or futures price fluctuations) obtained by the user in the current display interface can also be used by other applications.
[0088] Specifically, a graph neural network (GNN) is a type of neural network that operates directly on graph structures, primarily targeting data with non-Euclidean spatial structures (graph structures). It ignores the order of node input; during computation, the representation of a node is influenced by its surrounding neighbors, while the graph's connectivity remains unchanged. The graph structure representation enables graph-based reasoning. Typically, a GNN consists of two modules: a propagation module and an output module. The propagation module is used to transmit information between nodes in the graph and update state, while the output module is used to define objective functions based on vector representations of the graph's nodes and edges, tailored to different tasks. Examples of GNNs include graph convolutional networks (GCNs), gated graph neural networks (GGNNs), and graph attention networks (GATs) based on attention mechanisms. Furthermore, graph representation learning techniques, also known as graph embedding, primarily represent entities (and relationships) in multi-relational graphs using low-dimensional vectors or matrices. In the real world, typical multi-relational graphs are divided into two categories: knowledge graphs (KGs) and information networks. GEs primarily include knowledge graph embeddings (KGEs) and information network embeddings (NEs), both of which are suitable for the data processing methods in graph neural networks proposed in this application.
[0089] The structure of the data processing device in the graph neural network according to the embodiment of the present invention is described in detail below. The data processing device in the graph neural network can be implemented in various forms, such as a dedicated terminal with the processing function of the data processing device in the graph neural network (for example, a terminal that carries the graph neural network), or a server with the processing function of the data processing device in the graph neural network, for example, Figure 1 Server 200 in. Figure 2 The schematic diagram of the composition structure of the data processing device in the graph neural network provided by the embodiment of the present invention can be understood as follows: Figure 2 Only the exemplary structure of the data processing device in the graph neural network is shown, not the entire structure, and can be implemented as needed. Figure 2 Partial or complete structure shown.
[0090] The data processing device in the graph neural network provided by the embodiment of the present invention includes: at least one processor 201, a memory 202, a user interface 203 and at least one network interface 204. The various components in the data processing device in the graph neural network are coupled together through a bus system 205. It can be understood that the bus system 205 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 205 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 2 Various buses are labeled as bus system 205 .
[0091] The user interface 203 may include a display, a keyboard, a mouse, a trackball, a click wheel, keys, buttons, a touch pad or a touch screen.
[0092] It will be appreciated that the memory 202 may be volatile memory or non-volatile memory, or may include both. The memory 202 in this embodiment of the present invention can store data to support the operation of the terminal (e.g., 10-1). Examples of such data include any computer program used to operate on the terminal (e.g., 10-1), such as an operating system and application programs. The operating system includes various system programs, such as a framework layer, a core library layer, and a driver layer, which implement various basic services and handle hardware-based tasks. Application programs may include various application programs.
[0093] In some embodiments, the data processing device in the graph neural network provided by the embodiments of the present invention can be implemented in a combination of software and hardware. As an example, the data processing device in the graph neural network provided by the embodiments of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the data processing method in the graph neural network provided by the embodiments of the present invention. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0094] As an example of a data processing device in a graph neural network provided by an embodiment of the present invention being implemented by a combination of software and hardware, the data processing device in a graph neural network provided by an embodiment of the present invention can be directly embodied as a combination of software modules executed by a processor 201. The software module can be located in a storage medium, and the storage medium is located in the memory 202. The processor 201 reads the executable instructions included in the software module in the memory 202, and combines with the necessary hardware (for example, including the processor 201 and other components connected to the bus 205) to complete the data processing method in the graph neural network provided by an embodiment of the present invention.
[0095] As an example, the processor 201 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0096] As an example of hardware implementation of the data processing device in the graph neural network provided by an embodiment of the present invention, the device provided by an embodiment of the present invention can be directly executed by a processor 201 in the form of a hardware decoding processor. For example, it can be executed by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs) or other electronic components to implement the data processing method in the graph neural network provided by an embodiment of the present invention.
[0097] The memory 202 in the embodiment of the present invention is used to store various types of data to support the operation of the data processing device in the graph neural network. Examples of such data include any executable instructions for operating on the data processing device in the graph neural network, such as executable instructions. The program implementing the data processing method in the graph neural network according to the embodiment of the present invention may be included in the executable instructions.
[0098] In other embodiments, the data processing device in the graph neural network provided by the embodiments of the present invention can be implemented in software. Figure 2The data processing device in the graph neural network stored in memory 202 is shown. This device can be software in the form of programs and plug-ins, and includes a series of modules. As an example of a program stored in memory 202, a data processing device in the graph neural network can be included. The data processing device in the graph neural network includes the following software modules: information transmission module 2081 and information processing module 2082. When the software modules in the data processing device in the graph neural network are read into RAM by processor 201 and executed, the data processing method in the graph neural network provided by an embodiment of the present invention will be implemented. The functions of each software module in the data processing device in the graph neural network include:
[0099] Information transmission module 2081, used to obtain the initial structure of the first graph neural network and the data to be processed in the data stream;
[0100] An information processing module 2082 is configured to trigger a decoupling process and decouple the relation triples in the first graph neural network into a plurality of embedding components in response to the acquired data to be processed;
[0101] The information processing module 2082 is configured to determine graph embeddings corresponding to different embedding components based on different embedding components that match the relation triples in the first graph neural network;
[0102] The information processing module 2082 is used to trigger an update process based on the corresponding graph embedding result to update the relationship triples in the initial structure of the first graph neural network to form a second graph neural network.
[0103] Before introducing the data processing methods in graph neural networks proposed in this application, we first introduce the data processing methods of related technologies. Specifically, most existing graph representation learning models (such as various graph neural networks) assume that training data is static, ignoring the fact that data in the real world is constantly increasing (data changes in real time). This often leads to large deviations in their data processing results in practical applications, affecting user experience. Therefore, the problem that needs to be solved is how to enable existing GE processing methods (including KGE and NE) to continuously learn on new data while minimizing the loss of previously learned knowledge.
[0104] While continuous learning has been extensively studied in the fields of natural language processing (NLP) and computer vision, it has been relatively underexplored in the context of multi-relational graph embedding. Related techniques can learn representations on continuously growing graph data. However, this approach assumes that timestamp information is known in advance, which hinders its direct application to other types of multi-relational graphs.
[0105] In order to overcome the above defects, reference Figure 3 , Figure 3 This is an optional flow chart of a data processing method in a graph neural network provided by an embodiment of the present invention. The technical solution provided by this invention utilizes artificial intelligence (AI). Artificial intelligence (AI) is the theory, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI is the study of the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.
[0106] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0107] Machine learning (ML) is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers can simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is at the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of AI. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.
[0108] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, autonomous driving, drones, robots, smart medical care, smart customer service, etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0109] The graph neural network in the embodiment of the present application can be adaptively adjusted according to different usage scenarios. It can be understood that Figure 3The steps shown can be performed by various electronic devices running the data processing device in the graph neural network, for example, they can be dedicated terminals (such as financial product recommendation terminals, news recommendation terminals), electronic devices or electronic device clusters for the data processing function in the graph neural network. Figure 3 The steps shown are explained.
[0110] Step 301: The data processing device in the graph neural network obtains the initial structure of the first graph neural network and the data to be processed in the data stream.
[0111] In some embodiments of the present invention, obtaining the initial structure of the first graph neural network and the data to be processed in the data stream can be achieved by:
[0112] Based on the usage environment of the first graph neural network, determine the edge information set and the node information set in the first graph neural network; based on the edge information set and the node information set, determine the relationship triples in the initial structure of the first graph neural network; based on the usage environment of the first graph neural network, parse the different types of data in the data stream to determine the data to be processed that matches the usage environment of the first graph neural network. Taking the first graph neural network as a knowledge graph as an example, a typical knowledge graph can be regarded as a multi-relationship graph composed of many entities and relationships, in which nodes are used to represent entities and edges are used to represent relationships between entities. In data structures, graphs are composed of nodes (Vertex) and edges (Edge), but these graphs usually only contain one type of nodes and edges, while multi-relationship graphs usually include multiple types of nodes and multiple types of edges. In a knowledge graph, each node represents an "entity," and each edge represents a "relationship" between entities. Entities refer to real-world objects, such as names of people, places, organizations, concepts, and proper nouns. Relationships express connections between entities, such as "a person lives in Beijing," "Zhang San and Li Si are friends," and "logistic regression is the "precursor knowledge" for deep learning." Generally speaking, popular entities fall into two categories: those that have been mentioned frequently recently, such as film and television stars and popular TV series; and those that are relatively important and whose knowledge is frequently updated, such as film and television stars and variety shows.
[0113] Specifically, the multi-relation graph can be formally represented as G=(V, E), where V and Represent the node set and edge set on the graph respectively. Given a triple in G , their embedding can be expressed as , where d and l represent the vector dimensions.
[0114] Furthermore, because the data stream in the network updates in real time, different types of data in the data stream can be parsed based on the different usage environments of the graph neural network, determining the data to be processed that matches the usage environment of the first graph neural network. For example, in real-world question-and-answer applications, the first graph neural network often requires more semantically precise knowledge, such as "Luo Xyou is a famous male singer" and "Dogs are pets." Therefore, the first graph neural network artificially constructs a small category-based knowledge graph. The nodes of the first graph neural network are entities corresponding to keywords (such as Luo Xyou, male, and singer mentioned above), and the edges of the graph represent the relationships between nodes. In this category-based knowledge graph, the model includes "belongs to" and "equivalence" relationships. The "belongs to" relationship represents a relationship between entities, such as "Luo Xyou - belongs to → singer." During this process, the data stream can select data from multiple data sources in the form of web pages, logs, text, and / or tables as candidate entity data. Among them, the data sources include but are not limited to one or more of news channels, search logs and social platforms. Here, the data source is preferably the news channel. News has the characteristics of high timeliness, strong authenticity and high accuracy, which can increase the timeliness and effectiveness of data obtained from the news channel as entity candidate data, and has higher applicability.
[0115] In some embodiments of the present invention, when the first graph neural network is a knowledge graph, financial information recommendation can be implemented through the knowledge graph, for example, wherein the reference Figure 4 , Figure 4 This is a schematic diagram of the knowledge graph construction method in the graph neural network data processing method provided by an embodiment of the present invention. In a stock trading scenario, taking Tencent Technology, Qianhai Bank, and Tencent H shares as examples, Tencent Technology, Qianhai Bank, and Tencent H shares all belong to the technology sector, and are therefore related as belonging to the same sector. Furthermore, Tencent Technology and Qianhai Bank belong to the Shenzhen Stock Exchange, while Tencent H shares belong to the Hang Seng Index. Other stock indices and market index sector indices can be added to the knowledge graph in the same manner to complete the construction of the target stock's knowledge graph, providing a graph relationship structure for subsequent trend prediction. Information related to the same sector includes: industry affiliation (e.g., real estate), corresponding company code, and management affiliation (e.g., the Shanghai Stock Exchange). Therefore, the attribute information of the generated articles includes at least one of the following: industry affiliation, corresponding company code, management affiliation, price fluctuation range, price fluctuation amount, price limit status (whether price limit has occurred), price limit duration (if the stock has experienced price limit), and turnover rate. Since the information that constitutes the knowledge graph, such as the rate of increase or decrease, the amount of increase or decrease, the price limit status, the price limit time, and the turnover rate, changes in real time, it is necessary to continuously update the information in the knowledge graph to make the content of financial information recommendations through the knowledge graph more accurate.
[0116] Step 302: The data processing device in the graph neural network triggers a decoupling process in response to the acquired data to be processed and decouples the relation triples in the first graph neural network into multiple embedding components.
[0117] In some embodiments of the present invention, in response to the acquired data to be processed, triggering a decoupling process and decoupling the relation triples in the first graph neural network into multiple embedding components can be achieved by:
[0118] Based on the semantic features of the nodes in the relationship triples, determine a set of independent components that match the node vector information in the relationship triples in the first graph neural network; based on the set of independent components that match the node vector information in the relationship triples, decouple the relationship triples in the first graph neural network to form different embedding components that match the triples. Wherein, the i-th group of multi-relation data has a matching training set T i , validation set V i , test set Q i The i-th training set is defined as a set of relation triples, namely , where N is T i The total number of instances of . The definition of the group validation set and test set is similar to the training set. Usually, on the i-th group of data, the GE model will be trained on Ti to learn the representation of new triples, referring to Figure 5 , Figure 5 This is a schematic diagram of the first graph neural network decoupling process in an embodiment of the present invention, wherein when the i-th group training set T i When these new relation triplets appear, the first graph neural network needs to update the graph embedding representation according to these new relation triplets. Therefore, for each node , we can learn a decoupled node vector representation , the node representation consists of k independent components, namely and To represent a node The Kth semantic aspect of .
[0119] For a given T i Relation triples in , the goal of this module is to extract the semantic components in u and v that are most relevant to the relation r. Specifically, the attention mechanism can be used to model this process, where Assign K attention values , respectively represent the probability assigned to the Kth semantic component. Afterwards, the model selects the n semantic parts with the highest attention weights. Then, the existing GE method can be used to learn the specific features of the selected top n most relevant embedding components, and the feature learning process is represented as f. Here, It can be any graph embedding operation that aims to fuse the features of nodes u and v into the selected top-n relevant components.
[0120] Step 303: The data processing device in the graph neural network determines the graph embeddings corresponding to different embedding components based on the different embedding components that match the relation triples in the first graph neural network.
[0121] In some embodiments of the present invention, determining graph embeddings corresponding to different embedding components based on different embedding components matching the relation triples in the first graph neural network may be achieved by:
[0122] When the first graph neural network is a knowledge graph, the attention parameters matching the relation triples in the first graph neural network are determined, and the attention parameters matching the relation triples are normalized to achieve the representation of the degree of association between the edge information in the relation triples and the corresponding embedded components through the attention parameters. Therefore, we can directly set K attention values for each explicit relation r, and the Kth attention value is a trainable parameter that indicates the relevance of this edge to the Kth embedding component. The normalized calculation formula of attention weight is given in Formula 1:
[0123] Formula 1
[0124] In some embodiments of the present invention, the method further comprises:
[0125] When the first graph neural network is a knowledge graph based on reconstruction, at least two embedding components are determined based on the node parameters in the relationship triples and are processed in series; based on the result of the series processing, normalization processing is performed to achieve the determination of graph embeddings corresponding to different embedding components. When the first graph neural network is a knowledge graph based on bilinearity, at least two embedding components are determined based on the node parameters in the relationship triples and are processed in component splicing; based on the result of the splicing processing, convolution processing is performed to achieve the determination of graph embeddings corresponding to different embedding components. Specifically, since KGE models can be mainly divided into two categories: reconstruction-based models and bilinear-based models. Therefore, the data processing method provided by the present invention can adapt to the effectiveness of these two types of technologies in feature extraction. Specifically, two classic KGE models can be used as To extract features, including TransE (based on reconstruction): And ConvKB (bilinear based): ,in , is a node and nodes The concatenation of the top n most relevant embedding components selected; Represents the p-norm normalization operation; Represents a splicing operation; represents a convolutional layer with M filters, and Is a trainable matrix. It is a triple A scoring function that tends to give higher scores to valid triples.
[0126] In some embodiments of the present invention, determining graph embeddings corresponding to different embedding components based on different embedding components matching the relation triples in the first graph neural network may be achieved by:
[0127] When the first graph neural network is an information network, determine the parameter splicing result in the relation triple in the first graph neural network; perform linear change processing on the parameter splicing result in the relation triple to form corresponding attention parameters that match the relation triple; perform normalization processing on the attention parameters that match the relation triple to achieve the representation of the degree of association between the edge information in the relation triple and the corresponding embedded component through the attention parameters. Among them, since NE usually does not provide explicit relationships, it can be first determined based on the representation of node u and node v. Specifically, you can first and The overall embedding representation of is concatenated and a nonlinear transformation is performed to calculate , refer to formula 2:
[0128] Formula 2
[0129] Graph Attention Network (GAT) is a widely used learning embedding method in information networks. It collects information from the neighborhood of a node and assigns different importance weights to different neighboring nodes, thereby learning better node representation. Therefore, this model uses GAT as To extract the potential features of NE. Given the target node and its neighboring nodes {} , first according to the attention weight To determine each pair of nodes The top n most relevant components of the component. No. When embedding the parts, we only need to consider Those neighbor nodes v that are semantically related to the kth part The specific selection method is to see whether the first n most relevant semantics of (u, v) include the first In this way, the neighbors of the target node can be completely decomposed into different parts to play their roles separately, and then GAT is used to update each part. For details, refer to Formula 3:
[0130] Formula 3
[0131] in, and are two trainable matrices, h is the hidden layer size in GAT, and is a normalization function used to calculate the relative attention weight value of each neighbor in the k-th component.
[0132] Step 304: The data processing device in the graph neural network triggers an update process based on the corresponding graph embedding result to update the relationship triples in the initial structure of the first graph neural network to form a second graph neural network.
[0133] This allows the second graph neural network to utilize different data in the data stream to execute different business processes in the corresponding usage environment. For example, the second graph neural network can be used to perform financial information recommendations and financial product recommendations or predictions in financial information processing scenarios. Of course, it can also execute corresponding question-and-answer processes based on different data in the news data stream.
[0134] Among them, reference Figure 6 , Figure 6This is an optional flow chart of the data processing method in the graph neural network provided by the embodiment of the present invention, wherein the target user can select different financial scenarios for use. It can be understood that Figure 6 The steps shown can be performed by various electronic devices running the data processing device in the graph neural network, such as dedicated terminals, electronic devices or electronic device clusters that perform data processing functions in the graph neural network. Figure 6 The steps shown are explained.
[0135] Step 601: Determine the association relationship between different relationship triplets in the initial structure of the first graph neural network through the update process.
[0136] Step 602: Determine the relationship triples that need to be updated in the initial structure of the first graph neural network based on the association relationships of the different relationship triples.
[0137] Step 603: Keep part of the semantic information in the relationship triples that need to be updated unchanged, perform data processing on the relationship triples that need to be updated based on the data to be processed in the data stream, and form a second graph neural network to represent the semantic information of the data to be processed through the updated relationship triples.
[0138] Specifically, refer to Figure 7 , Figure 7 This is a schematic diagram of the updating process of different relationship triples of the first graph neural network in an embodiment of the present invention, wherein the updating of different relationship triples of the first graph neural network may include: 1) Neighbor activation: First, the module needs to determine Which relationship triples in the graph need to be updated? Since most nodes in a multi-relational graph are not independent, the newly appeared relationship triples are likely to affect the embedding of the old neighbor nodes that are connected to them. Therefore, for each relationship triple , their direct and indirect neighbor triplets (i.e., first-degree neighbors and second-degree neighbors) can be activated. Specifically, Neighbors are all nodes in the previous graph and node u Or the node v has a triple connected by an edge. In fact, since the degree of some nodes is relatively large, all neighbors are added to T i Training them together is computationally expensive. Therefore, a selection mechanism is used to update only a subset of relevant neighbors: for each neighbor triplet, it will be activated only if it shares the top n most important semantic components with the incoming target triplet.
[0139] 2) Partial semantic update: The present invention does not need to update all semantic embeddings of activated neighbors. For example, if the relation triple , you only need to update the top n semantic components that you pay most attention to, because the other semantic components will not be affected and do not need to be changed. The GE embedding method mentioned in the decoupling module can be used to update the embedding representations of the corresponding nodes and edges. During the training process, this model iteratively trains the relevant semantic components of new relationship triplets and activated neighbor relationship triplets. Through the training process shown in the previous steps, the graph neural network model can not only learn the embedding representation of new data, but also effectively prevent catastrophic forgetting problems, ensuring the continuous learning results of the graph neural network.
[0140] In some embodiments of the present invention, the method further comprises:
[0141] Determine the first loss function and the second loss function that match the second graph neural network; based on the first loss function and the second loss function, determine the loss function that matches the second graph neural network; based on the loss function that matches the second graph neural network, adjust the network parameters of the second graph neural network; until the loss function of the second graph neural network reaches the corresponding convergence condition, so as to realize the processing of the data to be processed in different usage environments by the second graph neural network. Among them, for the newly arrived multi-relation graph data Ti, the model can be iteratively trained on Ti and its activated adjacent relationship triples. The loss functions of these two parts can be expressed as L new and L old Specifically, when the first graph neural network is a knowledge graph, based on the data to be processed in the data stream, the corresponding invalid relationship triples are determined as negative samples; based on the negative samples, the first loss function and the second loss function that match the second graph neural network are determined.
[0142] For KGE, the soft margin distance loss function shown in Formula 4 can be used to train the model.
[0143] Formula 4
[0144] in Indicates that some invalid triplets obtained by negative sampling on the i-th group of data are used as negative samples. If , then y=1, otherwise, y=-1.
[0145] In some embodiments of the present invention, when the first graph neural network is an information network, the node labels and the number of node categories in the first graph neural network are determined; based on the node labels and the number of node categories in the first graph neural network, a first loss function and a second loss function that match the second graph neural network are determined. Specifically, for NE, a standard cross entropy loss can be used similar to GAT, and the corresponding graph neural network can be trained on the node classification task. The robustness of the graph neural network can be effectively improved by using a set of negative sample examples, where L new It can be expressed as shown in Formula 5:
[0146] Formula 5
[0147] Among them, C refers to the category of the node. If the node label is C, then ,otherwise ; N (Ti) is T i The node set, represents the total number of categories, and Is a trainable matrix. For KGE and NE, L old Is to use and L on the selected old relation triples new The same way to train.
[0148] In some embodiments of the present invention, determining a loss function that matches the second graph neural network based on the first loss function and the second loss function can be achieved by:
[0149] Determine a constraint loss function that matches the second graph neural network; determine the weight hyperparameter of the regularization term corresponding to the constraint loss function; based on the weight hyperparameter of the regularization term corresponding to the constraint loss function, determine the sum of the first loss function, the second loss function, and the constraint loss function as the loss function that matches the second graph neural network. Specifically, the fewer the number of semantic components that the relationship focuses on, the better the decoupling effect. Therefore, the regularization term L of the constraint loss can be added through Formula 6 norm , adjust the sum of the attention weights of the top n most relevant selected parts to 1:
[0150] Formula 6
[0151] Therefore, the final loss function of the model of the present invention is ,in represents the weight hyperparameter of the regularization term.
[0152] The data processing method in the graph neural network provided by this application can not only continuously learn from the new data, but also reduce the forgetting of the old knowledge, which is beneficial to the user experience. Figure 8 , Figure 8 The figure is a schematic diagram of the test effect of the data processing method in the graph neural network in the embodiment of the present invention. As the number of new relationship triples increases, the data processing method in the graph neural network provided by the present application achieves continuous learning, although the performance of the related technology model has declined to a certain extent. However, compared with the related technology, the data processing method in the graph neural network provided by the present application has achieved significantly better results. Therefore, the data processing method in the graph neural network provided by the present application is more effective in processing continuous multi-relationship graph data learning for the decoupling and dynamic updating of relationship triples, which is conducive to improving the user experience.
[0153] The chat corpus annotation method provided by the embodiment of the present invention is described below using a chat corpus annotation model encapsulated in a WeChat applet, wherein: Figure 9 FIG is a schematic diagram of a data processing application environment in a graph neural network according to an embodiment of the present invention, wherein Figure 9 As shown in the figure, with the development of human-computer interaction technology, more and more intelligent products based on this technology have emerged, such as chatbots. These intelligent products can chat with users and generate corresponding answers based on their questions. However, traditional technologies typically use pre-trained graph neural networks to select appropriate responses based on input and context. This process requires constructing a chat FAQ, storing query-response pairs, and then searching the pre-trained graph neural network FAQ to return replies similar to the query. Therefore, the intelligence of chatbots is limited by the quality and quantity of the FAQ library, and they cannot adapt to the ever-changing data flow in the network, which will affect the user experience.
[0154] To solve this problem, refer to Figure 10 , Figure 10 An optional flowchart of a data processing method in a graph neural network provided in an embodiment of the present invention can be used to process data in a graph neural network deployed in a question-answering server, specifically including the following steps:
[0155] Step 1001: Determine the graph neural network structure of the initial state in the question-answering server.
[0156] Step 1002: triggering a decoupling process performed by a decoupling module to decouple the relation triples into multiple embedding components and learn graph embeddings in different components.
[0157] Step 1003: triggering an update process executed by the update module to update the decoupled graph embedding according to the data corresponding to the new relation triples.
[0158] Step 1004: Determine the corresponding loss function and train the graph neural network to determine the model parameters of the new graph neural network in the question-answering server.
[0159] Step 1005: Receive the question information sent by the terminal and generate the corresponding answer through the new graph neural network.
[0160] refer to Figure 11 , Figure 11 A schematic diagram of the data processing method in the graph neural network provided in this application for realizing intelligent question and answer. In some embodiments of the present invention, taking the graph neural network as a knowledge graph as an example, when the first graph neural network is a knowledge graph and the initial state of the graph neural network is used in question and answer information processing, based on the corresponding question and answer information, the first knowledge graph corresponding to the target object in the question and answer information is determined; based on the target object, the updated data matching the target object in the network information is determined; the first knowledge graph of the target object is decoupled, and based on the updated data, different relationship triples in the first knowledge graph are updated to form a second knowledge graph, so as to realize the reply to the question information received by the terminal through the second knowledge graph. Therefore, reference Figure 11 In the process of realizing intelligent question and answer through the data processing method in the graph neural network provided by this application, it is known that some related triples of user nodes B and M are mainly related to three concepts: "family", "work" and "location". If a new relationship triple information (M, Daughter, A) appears in the conversation, we only need to update some information related to "family" in B, and there is no need to learn and update his "work" or "location" information. After the update, we can further infer that the triple (B, Daughter, A) is also valid. Therefore, by running the data processing method in the graph neural network provided by the present invention, the system's knowledge reserve can be continuously updated during the conversation, making the response more accurate.
[0161] refer to Figure 12 , Figure 12 This is a schematic diagram of the process of implementing financial information recommendation through the data processing method in the graph neural network in the embodiment of the present invention, combined with the previous Figure 4In the illustrated embodiment, during the graph neural network construction process, based on the target stock, sector, and market trend latent variables obtained in the previous steps, as well as the target stock's knowledge graph, financial information (such as stock products and sector information) can be recommended using the stock's knowledge graph. Furthermore, by inputting this information from the stock graph neural network into a trend prediction classifier, predicted trends for the stock, sector, and market can be obtained. It is known that some related triples between the target nodes Tencent Technology and Qianhai Bank are primarily related to three concepts: "stock," "listing location," and "sector information." If a new relation triple (Qianhai Bank, rising oil prices, capital purchases) appears in the conversation, we only need to update the information related to "rising oil prices" in Tencent Technology. Information such as its "stock code" or "shareholder information" does not need to be learned or updated. After this update, we can further infer that the triple (Tencent Technology, stock code, rising sector) also holds. Therefore, by running the data processing method in the graph neural network provided by the present invention, the system's knowledge reserve can be continuously updated in the process of financial information recommendation, making the recommendation of financial information and the prediction of stock changes more accurate.
[0162] Beneficial technical effects:
[0163] The embodiment of the present invention obtains the initial structure of a first graph neural network and the data to be processed in the data stream; in response to the obtained data to be processed, triggers a decoupling process and decouples the relation triples in the first graph neural network into multiple embedding components; based on different embedding components that match the relation triples in the first graph neural network, determines the graph embeddings corresponding to the different embedding components; based on the corresponding graph embedding results, triggers an update process to update the relation triples in the initial structure of the first graph neural network to form a second graph neural network. In this way, the processing of dynamic data by the graph neural network is realized, and the continuous learning of the graph neural network can be realized in different data to form a new graph neural network, while retaining the knowledge already acquired by the initial graph neural network, thereby improving the richness and foresight of data processing and enhancing the user experience.
[0164] The above description is merely an embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A data processing method in a graph neural network, characterized in that: The method comprises: Obtaining an initial structure of a first graph neural network and data to be processed in a data stream, wherein the data to be processed includes text data; In response to the acquired data to be processed, triggering a decoupling process and decoupling the relation triples in the first graph neural network into a plurality of embedding components and a plurality of semantic components of the relation triples, and assigning an attention value to each semantic component based on an attention mechanism, wherein a relevance of the semantic component to the relation in the relation triple is proportional to the attention value; Determining graph embeddings corresponding to different embedding components based on different embedding components matched with the relation triples in the first graph neural network; Based on the corresponding graph embedding results, an update process is triggered to update the relation triples in the initial structure of the first graph neural network and the first n semantic components in the semantic sequence, thereby forming a second graph neural network, so as to realize the execution of different business processes in the corresponding usage environment by utilizing different data in the data stream through the second graph neural network, wherein the semantic sequence is obtained by sorting the semantic components of the relation triples in descending order according to the attention value.
2. The method according to claim 1, characterized in that The obtaining of the initial structure of the first graph neural network and the data to be processed in the data stream includes: Determining an edge information set and a node information set in the first graph neural network based on a usage environment of the first graph neural network; Determining, based on the edge information set and the node information set, a relationship triple in an initial structure of the first graph neural network; Based on the usage environment of the first graph neural network, different types of data in the data stream are parsed to determine the data to be processed that matches the usage environment of the first graph neural network.
3. The method according to claim 1, characterized in that In response to the acquired data to be processed, triggering a decoupling process and decoupling the relation triples in the first graph neural network into a plurality of embedding components, including: Determining, based on semantic features of nodes in the relationship triples, a set of independent components that matches node vector information in the relationship triples in the first graph neural network; Based on a set of independent components that match the node vector information in the relationship triples, the relationship triples in the first graph neural network are decoupled to form different embedding components that match the triples.
4. The method according to claim 1, wherein The determining, based on different embedding components matching the relation triples in the first graph neural network, graph embeddings corresponding to different embedding components includes: When the first graph neural network is a knowledge graph, determining attention parameters that match relation triplets in the first graph neural network, The attention parameters matching the relation triples are normalized to achieve the purpose of characterizing the degree of association between the edge information in the relation triples and the corresponding embedded components through the attention parameters.
5. The method according to claim 4, characterized in that The method further comprises: When the first graph neural network is a reconstructed knowledge graph, at least two embedding components are determined based on the node parameters in the relationship triples and are connected in series; Based on the results of the concatenation process, normalization is performed to determine the graph embeddings corresponding to different embedding components.
6. The method according to claim 4, characterized in that The method further comprises: When the first graph neural network is a bilinear-based knowledge graph, at least two embedding components are determined based on the node parameters in the relationship triples and component splicing processing is performed; Based on the result of the concatenation process, a convolution process is performed to determine the graph embeddings corresponding to different embedding components.
7. The method according to claim 1, characterized in that The determining, based on different embedding components matching the relation triples in the first graph neural network, graph embeddings corresponding to different embedding components includes: When the first graph neural network is an information network, determining a parameter splicing result in a relation triplet with the first graph neural network; Performing linear change processing on the parameter concatenation result in the relation triplet to form corresponding attention parameters that match the relation triplet; The attention parameters matching the relation triples are normalized to achieve the purpose of characterizing the degree of association between the edge information in the relation triples and the corresponding embedded components through the attention parameters.
8. The method according to claim 1, characterized in that The updating process is triggered based on the corresponding graph embedding result to update the relationship triples in the initial structure of the first graph neural network to form a second graph neural network, including: Determining, through the updating process, association relationships among different relationship triplets in the initial structure of the first graph neural network; Determining, based on the association relationships between the different relationship triples, the relationship triples that need to be updated in the initial structure of the first graph neural network; Keeping part of the semantic information in the relation triples that need to be updated unchanged, performing data processing on the relation triples that need to be updated based on the data to be processed in the data stream, and forming a second graph neural network to represent the semantic information of the data to be processed through the updated relation triples.
9. The method according to claim 1, characterized in that The method further comprises: Determining a first loss function and a second loss function that match the second graph neural network; Determining a loss function that matches the second graph neural network based on the first loss function and the second loss function; Adjusting network parameters of the second graph neural network based on a loss function matching the second graph neural network; Until the loss function of the second graph neural network reaches the corresponding convergence condition, the data to be processed in different usage environments can be processed by the second graph neural network.
10. The method according to claim 9, characterized in that Determining a first loss function and a second loss function that match the second graph neural network includes: When the first graph neural network is a knowledge graph, determining corresponding invalid relationship triples as negative samples based on the data to be processed in the data stream; Determine a first loss function and a second loss function that match the second graph neural network based on the negative example samples, or, When the first graph neural network is an information network, determining the number of node labels and node categories in the first graph neural network; Based on the node labels and the number of node categories in the first graph neural network, a first loss function and a second loss function that match the second graph neural network are determined.
11. The method according to claim 9, characterized in that The determining, based on the first loss function and the second loss function, a loss function matching the second graph neural network includes: Determining a constraint loss function that matches the second graph neural network; Determining a weight hyperparameter of a regularization term corresponding to the constrained loss function; Based on the weight hyperparameter of the regularization term corresponding to the constrained loss function, the sum of the first loss function, the second loss function and the constrained loss function is determined as the loss function matching the second graph neural network.
12. The method according to claim 1, characterized in that The method further comprises: When the first graph neural network is a knowledge graph and the usage environment of the first graph neural network is question-answering information processing, Based on the corresponding question and answer information, determining a first knowledge graph corresponding to the target object in the question and answer information; Based on the target object, determining updated data in the network information that matches the target object; The first knowledge graph of the target object is decoupled, and different relationship triples in the first knowledge graph are updated based on the updated data to form a second knowledge graph, so as to reply to the question information received by the terminal through the second knowledge graph.
13. A data processing device in a graph neural network, characterized in that: The device comprises: An information transmission module, configured to obtain an initial structure of the first graph neural network and data to be processed in a data stream, wherein the data to be processed includes text data; an information processing module, configured to, in response to the acquired data to be processed, trigger a decoupling process and decouple the relation triples in the first graph neural network into a plurality of embedding components and a plurality of semantic components of the relation triples, and assign an attention value to each semantic component based on an attention mechanism, wherein a relevance of the semantic component to the relation in the relation triple is proportional to the attention value; The information processing module is configured to determine graph embeddings corresponding to different embedding components based on different embedding components that match the relation triples in the first graph neural network; The information processing module is used to trigger an update process based on the corresponding graph embedding result to update the relationship triples in the initial structure of the first graph neural network and the first n semantic components in the semantic sequence, forming a second graph neural network, so as to realize the execution of different business processes in the corresponding usage environment by using different data in the data stream through the second graph neural network, wherein the semantic sequence is obtained by sorting the semantic components of the relationship triples in descending order according to the attention value.
14. The device according to claim 13, characterized in that The device further comprises: The information processing module is configured to determine an edge information set and a node information set in the first graph neural network based on a usage environment of the first graph neural network; The information processing module is configured to determine, based on the edge information set and the node information set, a relationship triple in the initial structure of the first graph neural network; The information processing module is used to parse different types of data in the data stream based on the usage environment of the first graph neural network, and determine the data to be processed that matches the usage environment of the first graph neural network.
15. The device according to claim 13, characterized in that The device further comprises: The information processing module is configured to determine a parameter concatenation result with a relation triple in the first graph neural network when the first graph neural network is an information network; The information processing module is used to perform linear change processing on the parameter splicing result in the relation triple to form corresponding attention parameters matching the relation triple; The information processing module is used to normalize the attention parameters matching the relationship triples, so as to achieve the representation of the degree of association between the edge information in the relationship triples and the corresponding embedded components through the attention parameters.
16. An electronic device, characterized in that: The electronic device comprises: a memory for storing executable instructions; A processor, configured to implement the data processing method in the graph neural network according to any one of claims 1 to 12 when running the executable instructions stored in the memory.
17. A computer-readable storage medium storing executable instructions, characterized in that: When the executable instructions are executed by the processor, the data processing method in the graph neural network described in any one of claims 1 to 12 is implemented.
Citation Information
Patent Citations
Independent decoupling convolutional neural network representation algorithm for graph data
CN110889015A
Prediction method and system based on heterogeneous graph neural network model
CN111400560A