Graph natural language processing device, graph natural language processing method, and program
The graph natural language processing device addresses inconsistencies in converting graph networks to text by combining node and edge types with attributes into tokens, reducing computational complexity and maintaining graph data integrity.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- MITSUBISHI ELECTRIC CORP
- Filing Date
- 2025-03-03
- Publication Date
- 2026-05-15
AI Technical Summary
Existing graph natural language processing methods face challenges in converting graph networks to text due to inconsistencies and biases caused by arbitrary node and edge ID assignments, leading to exponential data augmentation requirements and computational complexity.
A graph natural language processing device that generates text data from graph data without relying on node or edge IDs by combining node types and attributes into node tokens and edge types and attributes into edge tokens, allowing for text representation without data augmentation.
This approach reduces computational complexity and data generation requirements while maintaining the integrity of graph data representation, ensuring efficient conversion and processing of graph data into text without biases.
Smart Images

Figure JP2025007342_15052026_PF_FP_ABST
Abstract
Description
Graph natural language processing device, graph natural language processing method, and program
[0001] This disclosure relates to a graph natural language processing device, a graph natural language processing method, and a program.
[0002] Graph networks, composed of nodes and edges, are used in various fields. For example, Patent Document 1 describes a technique for converting objects contained in a drawing into text information. This technique converts objects into graph information, which is a graph network, and then converts the graph information into text information.
[0003] International Publication No. 2021 / 014256
[0004] When converting a graph network to text, there are multiple ways to represent it, considering node names, node types, node order, edge names, edge types, and edge order. For example, a node has three elements: a node identifier (hereinafter referred to as node ID), node type, and node attributes. Of these elements, the node ID is an identifier that uniquely identifies each node in the graph. This node ID distinguishes between nodes and makes it possible to specify a particular node.
[0005] When converting a graph network to text, differing ranges of node IDs can lead to inconsistencies. For example, when converting a graph network to text containing names with the same first and last name, if node IDs such as "1", "2", "3", etc. are assigned to the text to ensure individual uniqueness, then in a dataset with 10 people with the same name and a dataset with 6 people with the same name, "_7" through "_10" will only appear in the former dataset. In this case, graph data containing "_7" through "_10" will be a factor that biases the generated results of the graph network.
[0006] Such biases in the number of graph data combinations caused by node IDs can occur due to the arbitrary nature of node ID assignment. For example, if the dataset is natural data without human intervention, according to Benford's Law, there will tend to be more texts with node IDs of "_1" or "_2" than those with "_8" or "_9".
[0007] However, if the dataset administrator arbitrarily assigns values to node IDs, certain node IDs may be favored depending on how they are assigned. For example, if the administrator prefers to assign "_1" or "_2" to node IDs, these node IDs will be more numerous than node IDs assigned other numbers. This could lead to inequality in node ID assignment during graph network generation.
[0008] To address this inequality, data can be augmented by increasing the number of permutations (different sequences of node IDs). For example, the original dataset can be copied multiple times, and the node IDs can be reassigned in a different order to each copy. This results in a different distribution of node IDs in each copy of the dataset. By using these multiple datasets, the arbitrariness in the distribution of node IDs can be equalized.
[0009] However, as the number of node IDs increases, the number of node ID combinations increases exponentially, leading to a problem where the amount of text data that needs to be created through data augmentation increases. For example, if there are 10 people with the same name, and each person is assigned a node ID from "_1" to "_10", then a massive amount of text data (10 factorial combinations) needs to be created through data augmentation. The same problem applies to edge IDs used to identify edges.
[0010] This disclosure aims to solve the above-mentioned problems and to provide a graph natural language processing device that can create text data from graph data without artificially inflating the data by assigning node IDs or edge IDs based on the number of different node ID or edge ID sequences.
[0011] The graph natural language processing device according to this disclosure includes a graph data acquisition unit that acquires graph data, a node extraction unit that extracts nodes including node types and node attributes from the graph data, an edge extraction unit that extracts edges including edge types and edge attributes from the graph data, and a processing unit that outputs a node token formed by combining the node types and node attributes extracted by the node extraction unit, an edge token formed by combining the edge types and edge attributes extracted by the edge extraction unit, and text arranged with the node tokens and edge tokens.
[0012] The graph natural language processing device described herein outputs node tokens that combine node types and node attributes, edge tokens that combine edge types and edge attributes, and text that arranges the node tokens and edge tokens. As a result, node IDs and edge IDs are not required, and therefore the graph natural language processing device described herein can create text data from graph data without augmenting the data by the number of different node IDs or edge IDs that would result from assigning node IDs or edge IDs.
[0013] This is a block diagram showing an example configuration of a graph natural language processing device according to Embodiment 1. This is a flowchart showing a graph natural language processing method according to Embodiment 1. This is a diagram showing an example of a graph network (1) in Embodiment 1. This is a diagram showing an example of a graph network (2) in Embodiment 1. This is a diagram showing an example of a graph network (3) in Embodiment 1. This is a block diagram showing a hardware configuration that realizes the functions of a graph natural language processing device according to Embodiment 1. This is a block diagram showing a hardware configuration that executes software that realizes the functions of a graph natural language processing device according to Embodiment 1. This is a flowchart showing a graph natural language processing method according to Embodiment 2. This is a diagram showing an example of a graph network (1) in Embodiment 2. This is a diagram showing an example of a graph network (2) in Embodiment 2. This is a diagram showing an example of a graph network (3) in Embodiment 2. This is a diagram showing an example of a graph network (4) in Embodiment 2. This is a diagram showing an example of a graph network (5) in Embodiment 2. This is a diagram showing an example of a graph network (6) in Embodiment 2. This is a diagram showing an example of a graph network (7) in Embodiment 2. This is a diagram showing an example of a graph network (8) in Embodiment 2. This is a diagram showing an example of a graph network (9) in Embodiment 2. This is a diagram showing an example of a graph network (10) in Embodiment 2. This is a diagram showing an example of a graph network (11) in Embodiment 2. This figure shows an example of a graph network (12) in Embodiment 2. This figure shows an example of a graph network in Embodiment 3. This is a circuit diagram showing the processing target circuit in Embodiment 5. This figure shows an example of a graph network (1) in Embodiment 5. This figure shows an example of a graph network (2) in Embodiment 5. This figure shows an example of a graph network (3) in Embodiment 5. This figure shows an example of a graph network (4) in Embodiment 5. This figure shows an example of a graph network (5) in Embodiment 5. This figure shows an example of a graph network (6) in Embodiment 5.
[0014] Embodiment 1. The graph natural language processing device according to Embodiment 1 acquires graph data representing a graph network (hereinafter referred to as "graph") and generates text data based on the graph data. In other words, the graph natural language processing device according to Embodiment 1 converts graph data into text data that is easy for a natural language processing device to process. Here, graph natural language processing is the process of converting graph data into text data that is easy for natural language processing. Furthermore, the graph natural language processing device according to Embodiment 1 itself may have a function to perform natural language processing on the text data obtained by converting graph data. In addition, the graph natural language processing device itself may have a function to convert the generated text data back into graph data. The function of converting from graph data to text data and the function of converting from generated text data back into graph data are in a conversion and inverse conversion relationship. If the natural language processing device is an external device connected to the graph natural language processing device according to Embodiment 1 by wire or wireless, the graph natural language processing device according to Embodiment 1 may access the natural language processing device and have it perform natural language processing on the text data.
[0015] (Basic Configuration of Graph Natural Language Processing Unit) Figure 1 is a block diagram showing an example configuration of a graph natural language processing unit 1 according to Embodiment 1. In Figure 1, the graph natural language processing unit 1 comprises a graph data acquisition unit 11, a node extraction unit 12, an edge extraction unit 13, and a processing unit 14. For example, the graph natural language processing unit 1 is implemented by a computer. The computer's memory stores programs that constitute information processing applications for realizing each of the functions of the graph data acquisition unit 11, the node extraction unit 12, the edge extraction unit 13, and the processing unit 14. The computer's processor executes the information processing applications read from the memory, thereby realizing each of the functions of the graph data acquisition unit 11, the node extraction unit 12, the edge extraction unit 13, and the processing unit 14. Note that when the processor is a CPU (Central Processing Unit), RAM (Random Access Memory) is often used, and the memory refers to memory for temporarily storing data or programs necessary for the computer's operation. Furthermore, when the processor is a GPU, the memory mentioned above often refers to VRAM (Video Random Access Memory), which is memory designed to enhance the ability to process large amounts of data quickly for image data.
[0016] (Graph Data Acquisition Unit) The graph data acquisition unit 11 acquires graph data that constitutes the graph network. For example, the graph data is stored in a storage unit (not shown in Figure 1) provided by the graph natural language processing unit 1. Alternatively, the graph data may be managed by an external device connected to the graph natural language processing unit 1 by wire or wireless connection. In this case, the graph data acquisition unit 11 reads and acquires the graph data from the storage unit. The graph data acquisition unit 11 may also access the external device using a communication device (not shown in Figure 1) provided by the graph natural language processing unit 1 and receive graph data from the external device.
[0017] The graph natural language processing device 1 may include an input device not shown in Figure 1. For example, when the input device receives an input operation from an operator, it outputs the input operation information to the graph data acquisition unit 11. The graph data acquisition unit 11 acquires graph data of the type specified by the operator based on the input operation information.
[0018] (Graph Data) Graph data is a dataset of geometric data, text data, or tabular data that can be represented by a graph. For example, the fully connected channels of a hidden layer in a neural network, atoms or interatomic bonds in a molecular structure, circuit components or wiring in an electrical circuit, quantum gates or quantum entanglement in a quantum circuit, relationships between individuals or organizations such as companies in a social network, communication networks with servers in a computer network, vehicles or traffic lights in a transportation network, logistics hubs or transportation networks in a road network or logistics network, connections between vertices of a mesh obtained from a physical simulation such as the finite element method or boundary element method, citations and citeds in papers, patents, websites or books, amino acids and connections between amino acids in a protein, nucleic acid bases and connections between nucleic acid bases in a gene, connections between products and customers in e-commerce (electronic commerce), connections between power plants, smart meters, and power equipment in a smart grid, network connections between devices and network equipment in security, or connections between synapses in the brain are all datasets represented by a graph structure consisting of at least nodes.
[0019] Furthermore, graph data is a dataset that includes at least nodes, and it is possible to additionally assign node types and node attributes, or edges, edge types and edge attributes. Graph data that does not have node types or node attributes will have a graph composed of nodes and edges. For example, when representing a "molecule" as a graph, the node type will be set to "atom," and the edge will be set to "bond between atoms." The edge type will be set to, for example, "covalent bond between atoms" or "atomic bond," and the edge attribute will be set to, for example, "bond energy." The node attribute can be set to, for example, "atomic mass."
[0020] When representing a "molecule" in a graph, it is not necessary to assign the type of atom to the node attribute in order to determine the "mass of the atom". However, for example, when representing a "carbon atom" in a graph, setting the node type to "carbon" and the node attribute to "isotope value" will allow the graph to include isotopic information. In addition, carbon has isotopes such as carbon-12, carbon-13, and carbon-14 that exist in nature, and the existence of isotopes from carbon-8 to carbon-22 that can be artificially created is also known.
[0021] Node types or node attributes, and edge types or edge attributes, are not necessarily required to define graph data, but they do create characteristics of the graph data. For this reason, much graph data has node types or node attributes. For example, in a graph representing an electrical circuit, nodes represent circuit components, and edges represent the wiring connecting the circuit components.
[0022] For example, when representing a social network as a graph, nodes represent individuals, and edges represent the relationships between individuals. Furthermore, by representing companies and users as nodes, and the edges as products of a specific company, it's possible to construct graph data that links the relationship between companies and users based on the products the users are using. Thus, graphs are composed of nodes and edges.
[0023] (Node Extraction Unit) The node extraction unit 12 extracts nodes from the graph data acquired by the graph data acquisition unit 11. For example, the node extraction unit 12 extracts node types from the nodes included in the graph data. Node types include homogeneous graphs, where all nodes in a graph network are of the same type, and heterogeneous graphs, where multiple types of nodes exist and each node has a different role or characteristic. An example of a case where all nodes are of the same type is a social network where general people are represented by nodes. An example of a case where multiple types of nodes exist is a knowledge graph where different entities such as people, places, or events are represented by nodes.
[0024] Furthermore, the node extraction unit 12 extracts node attributes from the nodes included in the graph, which indicate the attributes of each node. Node attributes are additional information that each node possesses, representing the characteristics or state of the node. For example, when representing a social network in a graph, if the node type is "user," the node attributes will include information such as username, age, place of residence, interests, or number of friends.
[0025] (Edge Extraction Unit) The edge extraction unit 13 extracts edges from the graph data acquired by the graph data acquisition unit 11. In edge extraction, the unit focuses on the nodes included in the graph and extracts the edges connected to the ends of the nodes. The edge extraction unit 13 may also extract the edge ID of the edge included in the graph data during processing by the processing unit 14. For example, in the case of a multi-edge with two or more edges between two nodes, the nodes connected to both ends of the edge are the same, so it is not possible to narrow down the edge to one using only information about the nodes connected to both ends of the edge. In this case, it is possible to identify the edge that makes up the multi-edge by using the edge ID, which exists only once in the graph.
[0026] (Processing Unit) The processing unit 14 has the function of creating node tokens by combining the node type and node attributes extracted by the node extraction unit 12, the function of creating edge tokens by combining the edge type and edge attributes extracted by the edge extraction unit 13, and the function of creating text by arranging the node tokens and edge tokens. The processing unit 14 creates node tokens by combining the node type and node attributes as a single word. At this time, the processing unit 14 may hold this node token and the node ID or node name as a set, and may also hold the edge ID or edge name and the node ID or node name as a set. As a result, when the processing unit 14 selects an edge from the graph, for example, it can identify the nodes connected to both ends of the selected edge from the node ID or node name, and thus associate the edge with the node token.
[0027] The graph natural language processing device 1 may also include a display processing unit, which is not shown in Figure 1. For example, the display processing unit generates display information for displaying the text data created by the processing unit 14 and outputs the generated display information to a display device. The display device displays the text data created by the processing unit 14 based on the display information. The display device may be a separate display device from the graph natural language processing device 1, or it may be a display unit included in the graph natural language processing device 1. Furthermore, the display device may be a display unit included in an external device that is communicated with the graph natural language processing device 1 via a network.
[0028] Furthermore, the graph natural language processing unit 1 may include an output unit, which is not shown in Figure 1. The output unit outputs the text data created by the processing unit 14 to an external device. For example, the output unit outputs the text data created by the processing unit 14 as graph data to a graph neural network. The graph neural network is a neural network that learns graph structures using the input graph data. The output unit may also output some or all of the graph data output to the graph neural network to an external device.
[0029] In a typical graph neural network, node IDs are not explicitly assigned to nodes. However, when converting a graph into an adjacency matrix that can be processed by a graph neural network, it is necessary to assign node IDs to one of the rows and columns of the adjacency matrix. For example, considering node A in a graph neural network with N nodes, the adjacency matrix will be an N x N matrix. The elements in the Mth row and Mth column of this adjacency matrix indicate whether or not node A is connected to any other nodes, and the diagonal elements represent self-loops. Note that M is an integer between 0 and N (exclusive). Thus, even though node A is not explicitly assigned a node ID, the integer M can be considered the node ID of node A.
[0030] In graph neural networks, node attributes are assigned in association with node IDs. Therefore, along with an N x N adjacency matrix, there exists a dataset representing node attributes, expressed as an N x B matrix. Node IDs are used to associate the elements of the adjacency matrix with the dataset representing node attributes. B represents a node type classified into B categories. In graph neural networks, node attributes are assigned as one-hot vectors such that when the node attributes of adjacent nodes are aggregated (aggregated) to the target node, the Hadamard product between node information of different types is orthogonal. Therefore, the number of elements in the matrix must be equal to or greater than the number of node types; in a 1 x N matrix, N must be greater than the number of node types. Typically, node IDs are not explicitly assigned, but rather processed by associating the row number of the adjacency matrix with the row number of the dataset representing node attributes. However, in large graphs, subgraphs are sometimes used. In this case, node IDs may be explicitly assigned.
[0031] Therefore, the node ID and the graph data are closely related, and in a graph or a graph neural network, it is not obvious to replace the node ID with a node token. Furthermore, replacing the node ID with a node token does not necessarily guarantee uniqueness, unlike when using the node ID.
[0032] The same applies to the edge ID. In order to associate the row number of the adjacency matrix with the edge type or edge attribute, it is necessary to hold the position of the target edge with the row number. Considering the edge ID of the target edge, all edges have an edge ID.
[0033] Furthermore, the node ID or edge ID is used in the sense of a name that has uniqueness such that there is only one in a single graph. For this reason, if a name that is unique to a single graph can be assigned, the node ID can be replaced with a node name, and the edge ID can be replaced with an edge name.
[0034] In contrast, the graph natural language processing device 1 according to Embodiment 1 expresses the characteristics of nodes and edges relatively by combining node tokens representing nodes and edge tokens representing edges, which is not obvious.
[0035] Generally, a graph network consists of six elements: node ID, node type, node attribute, edge ID, edge type, and edge attribute. When generating a graph using natural language processing, there is a physical constraint that the graph cannot be created unless the six elements are generated in a specific order or number. This is equivalent to replacing the node ID with a single word that combines the node type and node attribute, and replacing the edge ID with a single word that combines the edge type and edge attribute. By combining these, the six elements that make up the graph become four elements, and by further replacing the IDs, the four elements become two elements. This gives it the remarkable characteristic that it can be converted from text to a graph regardless of the order in which the two elements are generated. Furthermore, by adopting this approach, it is possible to avoid using node IDs and edge IDs, and the node type, node attribute, edge type, and edge attribute are output in the defined order, while the node attribute for node type and the edge attribute for edge type are determined only by the combinations included in the dataset, thus achieving the special effect of not generating graph data with abnormal characteristics. Furthermore, the relationship between node types and node attributes can be that of node attributes related to node types, or that there is no direct relationship between node types and node attributes. For example, in an SNS, if the node type of a node representing a "person" is "native language," and the node attribute is "age," then there is no relationship between the node type and node attribute. On the other hand, if the node type is "native language," and the node attribute is "place of birth and upbringing" expressed in longitude and latitude, then there is a relationship between the node type and node attribute. Also, edge types and edge attributes do not have a direct relationship. For example, in an SNS, if the edge type representing the relationship between people is "relationship," and the edge attribute is "number of years the relationship has lasted," then there is a relationship because the edge attribute is supplementary information to the edge type. On the other hand, if the node type is "relationship" and the edge attribute is the difference in wake-up times, then there is no relationship between the two, and therefore the information is unrelated. In this way, node tokens and edge tokens can be constructed regardless of whether there is a relationship between node types and node attributes, or between edge types and edge attributes.Furthermore, a node token may have two or more node types or two or more node attributes, and an edge token may have two or more edge types or two or more edge attributes.
[0036] (Graph natural language processing method) FIG. 2 is a flowchart showing the graph natural language processing method according to Embodiment 1, and shows a series of operations by the graph natural language processing apparatus 1. The graph data acquisition unit 11 acquires graph data (step ST1). For example, when an external server manages graph data, the graph data acquisition unit 11 communicates with the external server through the communication unit and acquires the graph data received from the external server. The graph data acquired by the graph data acquisition unit 11 is output to the node extraction unit 12 and the edge extraction unit 13.
[0037] The node extraction unit 12 extracts nodes from the graph data acquired by the graph data acquisition unit 11 (step ST2). For example, the node extraction unit 12 extracts the node type from the graph data and further extracts the node attributes. The edge extraction unit 13 extracts edges from the graph data acquired by the graph data acquisition unit 11 (step ST3). Also, if necessary when extracting the nodes connected to both ends of the edge, the node extraction unit 12 may extract the node ID or the node name from the graph data. Since these are only used for the extraction of nodes, they do not appear in the output of the processing unit 14.
[0038] Among the graph data, there are those having node types and node attributes, those not having at least one of these, those having edge types and edge attributes, or those not having at least one of these. Hereinafter, the graph data having node types and node attributes will be described. However, the graph natural language processing apparatus 1 is also applicable to graph data having only node types without node attributes or graph data having only node attributes without node types. For example, in graph data having only node types, it is desirable to set the node attributes to blank and make the node types and node tokens equal.
[0039] The processing unit 14 executes the creation process (step ST4). Here, the processing unit 14 creates node tokens by combining the node types and node attributes extracted by the node extraction unit 12, edge tokens by combining the edge types and edge attributes extracted by the edge extraction unit 13, and text by arranging the node tokens and edge tokens. There are two ways to arrange the node tokens and edge tokens: arranging the edge tokens around the node tokens, and arranging the node tokens around the edge tokens. These will be called node-centered arrangement and edge-centered arrangement, respectively.
[0040] Node-centered arrangement is a method of selecting a node in order from all the nodes included in the graph, designating it as the node of interest, and arranging the edge tokens of the edges connected to that node. In Embodiment 1, the order in which the node of interest and the edges connected to it are written in the text does not matter, but the text is created in the order of node of interest followed by the connected edges. This results in a string in which zero or more edge tokens are placed consecutively around a single node token.
[0041] Edge-centered arrangement is a method of selecting an edge from all the edges included in the graph in order to be the focus edge, and then arranging the node tokens of the nodes connected to that focus edge. In Embodiment 1, it is assumed that there are nodes at both ends of the edge. Therefore, the order in which the focus edge and the nodes connected to it are written in the text does not matter, but the text is created in the order of focus edge, then connected node. This results in a string in which two node tokens are placed consecutively for each edge token.
[0042] In a graph with two or more nodes and edges, the process of selecting a node or edge of interest involves selecting every node and edge in the graph one by one so that each selected node and edge becomes a node or edge of interest at least once.
[0043] In the intermediate processing for extracting edges connected to a node, or for extracting nodes connected to both ends of an edge, node IDs or edge IDs are obtained if necessary. That is, adjacent nodes can be extracted by extracting the node ID designated as the node of interest, extracting the edge IDs connected to that node ID, and extracting node IDs other than the node ID of the node of interest to which those edge IDs are connected.
[0044] Furthermore, the edge ID of the edge designated as the edge of interest is extracted, the node IDs of the nodes connected to the edge with that edge ID are extracted, and the node tokens of the nodes with that node ID are listed alongside the edge of interest. In addition to using node IDs or edge IDs, if there is only one node name or node token with the same name in the graph, the node name or node token may be used instead of the node ID. If the text data created by the processing unit 14 does not contain node IDs, node names, edge IDs, and edge names, it may retain all of the node IDs, node names, edge IDs, and edge names.
[0045] Graph data can vary depending on the dataset, with some having node types and node attributes and others not; however, this explanation will assume that the data has node types and node attributes. Note that the graph natural language processing device 1 according to Embodiment 1 can be used for datasets with only node types and no node attributes, and for datasets with only node attributes and no node types.
[0046] For example, in graph data that only has node types, the node token may have a node attribute that is blank, making the node type and node token equal, or it may have a string indicating that it is blank (e.g., "None"), or the number of edges connected to the node, which is equal to the node degree, may be used as the node attribute.
[0047] Furthermore, a single node may have multiple node types, and a single node may have multiple node attributes. For example, if a node has multiple node types, the node token can simply list the node types.
[0048] Furthermore, if graph data includes elements with and without node attributes, elements without node attributes may be assigned a specific character representing an empty node attribute, such as "None," to act as a node token. Alternatively, the node type alone may be used to represent a node token.
[0049] Furthermore, a node token representing an empty node may be set for the other end of an edge where a node is connected to only one end. For example, it is desirable to define a new node token to represent an empty node when there is a node at only one end of an edge. This allows all edges to be converted into text data that can be processed as natural language, assuming that there are nodes at both ends. Therefore, the graph natural language processing method according to Embodiment 1 can be used even when nodes are not necessarily connected to both ends of an edge.
[0050] The same applies to edge tokens; depending on the dataset, they may or may not have edge types or edge attributes, but we will describe them as data that has edge types and edge attributes. Note that the graph natural language processing method according to Embodiment 1 can be used for datasets that have only edge types and no edge attributes, and datasets that have only edge attributes and no edge types. For example, if only edge types are present, the edge token may have a character that represents a space, such as "-", set for the edge attribute, and if there are no edge attributes at all, the edge token may be created using only the edge type without using edge attributes.
[0051] When creating edge tokens based solely on edge type, multiple identical edge tokens may be generated, making them unsuitable as substitutes for edge IDs. However, in such cases, the edge attribute can be set to the maximum degree or sum of the node degrees of the nodes at both ends of the edge, thereby bringing the edge token closer to the characteristics of the edge ID.
[0052] Furthermore, an edge may have multiple edge types, and an edge may have multiple edge attributes. For example, if an edge has multiple edge types, the edge token can simply list the edge types. However, if node types or node attributes are subdivided, the number of node token types will increase.
[0053] As edge types or edge attributes are subdivided, the number of edge token types increases. For natural language processing of strings containing node tokens or edge tokens, it is desirable to adjust the number and precision of node types or node attributes so that each dataset contains at least two identical node tokens.
[0054] Similarly, with respect to edge tokens, it is desirable to adjust the number and significant digits of edge types or edge attributes so that at least one edge token is included in two or more of the same dataset.
[0055] For example, graph data is a dataset in which identical node tokens are included in a graph network by changing the number of classifications of node types or the number of significant digits of node attributes. If the numerical distribution of node attributes is uniform, and the information has 5 significant digits, and there are 1,000 nodes of the same node type, the probability of two node tokens being identical becomes low. In that case, for example, if the values are "A: 1.9453" and "A: 5.4532" with 5 significant digits, then by reducing the number of significant digits to 2, such as "A: 1.9" and "A: 5.5", two or more identical node tokens can be obtained.
[0056] Furthermore, graph data may be datasets in which two or more different node tokens are included in the graph network by changing the number of classifications for node types or the number of significant digits for node attributes. For example, if there are too many identical node tokens, the node tokens may not be able to easily replace node IDs, and the characteristics of the graph information may be lost. In such cases, the node degree or the characteristics of adjacent edges may be assigned as node attributes or edge attributes to increase the number of types of node tokens or edge tokens. Note that graph data may also be datasets in which identical edge tokens are included in the graph network by changing the number of classifications for edge types or the number of significant digits for edge attributes. Furthermore, graph data may also be datasets in which two or more different edge tokens are included in the graph network by changing the number of classifications for edge types or the number of significant digits for edge attributes.
[0057] (Node Center Representation) In Embodiment 1, node types are described as a finite number of discrete values that can be classified, and node attributes are described as continuous or discrete values related to node types. For example, if we consider a social network as graph data, nationality or gender can be set as the node type, and age, height or weight can be set as the node attribute.
[0058] Furthermore, the node ID may be a unique number assigned to each individual. If the node ID is used as a name, there is a problem in that unity cannot be maintained if there are people with the same name, and when one node ID is selected, it cannot be assigned to a single node.
[0059] While it's possible to address the lack of unity by renaming nodes, the method of renaming is arbitrary, offering flexibility. For example, if there are two people with the same name, one could be assigned "_1" and the other "_2" to maintain unity, but it's also possible to assign "_2" to one and "_1" to the other. In this case, when generating text representing the graph using natural language processing, nodes with "_1" are more likely to be generated, resulting in inequality between nodes. To resolve this inequality, one can create text with altered combinations by augmenting the data, similar to how permutations work.
[0060] However, if, for example, there are 10 people with the same name, there are 10 factorial (10! = 3,628,800) possible permutations. Therefore, to represent graph data as text including node IDs, it is necessary to create 10 factorial texts through data augmentation. In this way, as the number of nodes increases, the number of texts created through data augmentation from a single graph data set increases exponentially, making it difficult to process the created text data in natural language from the perspective of computational complexity and required memory. This is a major problem for molecules and genes, which have a small number of node types. For example, molecules contain many carbon or hydrogen atoms, so there can be many combinations for assigning IDs.
[0061] Furthermore, since DNA or RNA is composed of only five types of nucleic acid bases (adenine, guanine, cytosine, thymine, and uracil), there are many identical nucleic acid bases. In this case, the assignment of node IDs becomes more arbitrary. For example, it is known that the human base sequence contains approximately 300 million of the four types of bases: adenine, guanine, cytosine, and thymine. If there are 100 million of these base sequences, then 100 million factorial text generation possibilities are required.
[0062] In text like this, nodes assigned the first ID are easily generated, but nodes assigned the 100 millionth ID, or the edges connected to those nodes, are less likely to be generated, creating an inequality. While such an inequality can still result in a normal graph, it will lead to a bias in the generated graph. Data augmentation to eliminate such inequalities makes it impossible to train natural language processing within a realistic timeframe or cost.
[0063] Therefore, based on the idea that node IDs and edge IDs are essential for management but hinder graph generation, we introduce node tokens that combine node type and node attributes instead of node IDs, and edge tokens that combine edge type and edge attributes instead of edge IDs.
[0064] For example, if we only consider node types, there are often multiple identical nodes. In the social work example above, if we define node types as people of the same nationality, then in large graph data, there will be many people of the same nationality, making it unsuitable as a substitute for a node ID that requires uniqueness.
[0065] Similarly, with respect to node attributes, if we consider people with the same height and weight, there will be many of them, and they cannot replace the unique characteristics of a node ID. However, by utilizing the fact that uniqueness improves when node types and node attributes are combined, it can serve as a substitute for a node ID. That is, if we consider nationality, height, and weight as a single node, and call this node a node token, then the node token will have enough uniqueness to serve as a substitute for a node ID.
[0066] Furthermore, combining elements such as gender, age, or place of residence, in addition to nationality, into a string that can be processed as a single word using natural language processing improves the unity of node tokens and can serve as a substitute for node IDs. This allows for the representation of graphs without using node IDs, and consequently, the conversion of graph data into text. Similarly, combining edge types and edge attributes can improve unity and potentially serve as a substitute for edge IDs.
[0067] The text contains node tokens and edge tokens of edges connected to the node of the node token, separated by delimiters. It also contains edge tokens and node tokens of nodes connected to the edges of the edge token, separated by delimiters. However, ensuring unity can be difficult with node tokens or edge tokens alone. Even without unity, nodes can be defined by their relative relationships to surrounding nodes, allowing text to be created without losing the characteristics of the graph data. That is, the relative relationships of nodes or edges are defined by representing the text as a combination of the node of interest (the node of interest) and the edge tokens connected to that node. This further improves unity and achieves an effect equivalent to node IDs and edge IDs.
[0068] Conversely, defining a graph based on node IDs, node types, node attributes, and connections between nodes via edges is redundant compared to representing the graph in text. Furthermore, node IDs can be replaced by defining nodes relatively using edge tokens, combining node types and node attributes.
[0069] Thus, when creating a node token by combining node type and node attribute, or an edge token by combining edge type and edge attribute, Embodiment 1 uses a colon ":" as a delimiter. However, if node type and node attribute can be obtained from a node token, or edge type and edge attribute from an edge token, the delimiter does not necessarily have to be used. For example, if all node types, including test data, can be determined, and combining node type and node attribute results in only the node type being extracted as a single node type, then the delimiter is unnecessary.
[0070] In the example of a social network, the number of country names is limited, all country names (node types) are known, and height can be represented numerically, so node tokens can be represented without delimiters, for example, as "Nationality Height". Alternatively, the order of node type and node attribute can be reversed, resulting in "Height Nationality". By replacing all nodes in the graph data with node tokens in this way, the creation of text through data augmentation becomes unnecessary, and the computational complexity can be reduced, resulting in text data that can be processed in natural language.
[0071] Next, we will explain the additional effects obtained by creating node tokens. While node types and node attributes are required to have related values, in text generation using natural language processing, related values are not always output.
[0072] In the case of social networks, values that should be associated with height (m) at a given position within the generated text may be generated as values associated with weight (kg), the combination of height and weight may be abnormal data, weight may not be generated when only height is entered, or multiple values of height may be generated. Because the text data that makes up these graphs cannot be graphed, it must be treated as abnormal data where physical constraints are not maintained. This leads to the problem of reduced graph generation efficiency.
[0073] Furthermore, there is a problem in that it is difficult to determine if data with an abnormal combination of height and weight is abnormal. In contrast, in Embodiment 1, node types and node attributes can be grouped together as a single word, so that physical constraints are maintained during training and the data is generated while preserving those physical constraints. For this reason, all generated text can be converted into a graph.
[0074] Next, we will describe edge tokens in which the edges and edge IDs connected to node tokens are replaced with edge types and edge attributes. In the edge extraction unit 13, edges are extracted from the graph data. The edge type is similar to the node type, and the edge attributes are similar to the node attributes.
[0075] It is desirable to assign edge types to a finite number of discrete values. For example, when considering molecules in a graph, the edge types represent interatomic bonds such as covalent bonds, ionic bonds, metallic bonds, van der Waals forces, polar attractive forces, and hydrogen bonds.
[0076] Furthermore, edge attributes can be thought of as representing the bond energy of each bond. For example, since the bond energy of the shared hydrogen molecules is 432 kJ / mol, the edge token can be "covalent bond: 432 kJ / mol".
[0077] Furthermore, if the units are common across all edge attributes, the units can be omitted, and the delimiter between the edge type and edge attribute can be omitted, resulting in "covalent connection 432".
[0078] Furthermore, the order of edge types or edge attributes does not matter as long as they are common across the entire dataset, so you can use "432 covalent bond" or "covalent 432 kJ / mol". Moreover, since the edge types are limited and all are known, you can also use "432 kJ / mol covalent bond" as it allows for accurate classification of edge types and edge attributes.
[0079] The delimiters are explained below. The first is the "first delimiter" used when creating a node token by combining the node type and node attributes. The second is the "second delimiter" used when creating an edge token by combining the edge type and edge attributes.
[0080] The text may include text formed by concatenating node types and node attributes using a first delimiter that is not included in the strings constituting node types or node attributes and does not result from concatenating node types and node attributes. The text may also include text formed by concatenating edge types and edge attributes using a second delimiter that is not included in the strings constituting edge types or edge attributes and does not result from concatenating edge types and edge attributes.
[0081] In particular, when selecting a delimiter, it is necessary that it is not included in the string that constitutes the node token or edge token. For example, if the node token is "A B" and the delimiter is " ", the delimiter will incorrectly split the node token into "A" and "B" as intended. In that case, it can be resolved using the two methods described above, using the first and second delimiters.
[0082] One method is to use a delimiter consisting of consecutive different characters, for example, three consecutive spaces that are not included in the node token and edge token. Additionally, if you use two or more characters as a delimiter, you must select a string that does not result from combinations of node tokens, edge tokens, or other combinations of node tokens.
[0083] For example, if the node token of the node of interest is "A:a" and the edge token of the connecting edge is "a:a aa:a", then if the delimiter is "a:aa", then "A:a a:a aa:a" becomes "A:aa:aaa:aaaa:aaaa:a", and the edge token cannot be split. In particular, since the delimiter is not used in the learner of natural language processing, it is desirable to use a special string that does not affect the computational cost and is sufficiently long when the input text during inference is unknown.
[0084] However, it is also desirable to use half-width spaces in the tokenizer for natural language processing. In that case, it is desirable to replace half-width spaces contained in node tokens or edge tokens with another character, or to remove half-width spaces, as a second method. For example, the processing unit 14 may replace half-width spaces contained in node tokens with a first replacement character containing an empty string, replace half-width spaces contained in edge tokens with a second replacement character containing an empty string, and use a half-width space as the delimiter. That is, a first string containing an empty string that does not contain half-width spaces may be defined as the first replacement character, and half-width spaces may be removed from node tokens by replacing them with the first string. Similarly, a second string containing an empty string that does not contain half-width spaces may be defined as the second replacement character, and half-width spaces may be removed from edge tokens by replacing them with the second string. However, the first and second strings can be any strings as long as they can separate node tokens into node types and node attributes, and edge tokens into edge types and edge attributes. Furthermore, the first and second strings may be the same for the node token and edge token, or they may be different strings. In the example above, the node token "A B" is represented as "AB" or "A_B".
[0085] The node tokens and edge tokens created in this way are shown in their best form using a specific example in Figure 3. Figure 3 is a diagram showing an example (1) of a graph network in Embodiment 1, and shows a simple graph composed of four nodes and four edges. A simple graph is a graph that has zero or only one edge between two nodes, that is, no more than two edges between two nodes, and no self-loops, where the edges are from one node to the same node.
[0086] The graph in Figure 3 has a node of node type A and node attribute 1000, a node of node type B and node attribute 1, a node of node type B and node attribute 10, a node of node type C and node attribute 100, an edge of edge type e and edge attribute 1, an edge of edge type e and edge attribute 10, an edge of edge type f and edge attribute 1, and an edge of edge type f and edge attribute 1. The processing unit 14 creates node tokens by combining the node type and node attribute for these nodes and edges, and creates edge tokens by combining the edge type and edge attribute. The first delimiter may be a string that does not result from the combination of node type, node attribute, edge type and edge attribute. The second delimiter may also be a string that does not result from the combination of node type, node attribute, edge type and edge attribute. Specifically, if the delimiter between node type and node attribute is defined as a colon ":", the node tokens will be "A:1000", "B:1", "B:10", and "C:100". Furthermore, if we define the delimiter between edge type and edge attribute as a colon ":", then the edge tokens will be "e:1", "e:10", "f:1", and "f:1".
[0087] Note that if the node type and edge type do not contain numbers, and the node attribute and edge attribute consist only of numbers, a delimiter is not required. However, for clarity, a delimiter will be used in the explanation. The node tokens "B:1" and "B:10" are connected to the edge token "e:10". The node tokens "B:10" and "A:1000" are connected to the edge token "f:1". The node tokens "B:10" and "A:1000" are connected to the edge token "f:1".
[0088] As a result, if we use a half-width space as the delimiter between node tokens and edge tokens, and between edge tokens themselves, then in a node-centered configuration, it would look like this: "A: 1000 f: 1 f: 1 B: 1 e: 1 B: 10 e: 1 e: 10 f: 1 C: 100 e: 10 f: 1"
[0089] For clarity, the following representation will be shown with line breaks between edge tokens and node tokens: A: 1000 f: 1 f: 1 B: 1 e: 1 B: 10 e: 1 e: 10 f: 1 C: 100 e: 10 f: 1
[0090] Even though there are two types of tokens—space delimiters and newline delimiters—neither delimiter contains any information. Therefore, while it is possible to remove unnecessary delimiters from the generated text, this leads to an unnecessary increase in computational cost. Consequently, in data handled by natural language processing included in graph natural language processing, it is desirable to replace newline delimiters with space delimiters.
[0091] In natural language processing, the delimiter, either a half-width space or a substitute for a half-width space, is omitted from the training data handled by the learner used in natural language processing, as the tokenizer divides the text into node tokens or edge tokens. Furthermore, the node tokens or edge tokens generated by a trained learner also do not contain delimiters. Therefore, it is desirable to insert a delimiter between each generated node token or edge token before converting them to text or a graph.
[0092] Thus, the text data created by the processing unit 14 includes three types of elements: node tokens, edge tokens, and delimiters. The delimiters are removed by a tokenizer used in natural language processing to extract words from a string. As a result, the generated text contains only two types of words based on node tokens and edge tokens. Consequently, the physical constraints for constructing the graph are preserved. Therefore, regardless of the order in which the node tokens and edge tokens are generated as text, the resulting text can be converted into a graph.
[0093] (Edge Center Representation) In Embodiment 1, edge types are described as a finite number of discrete values that can be classified into classes, and edge attributes are described as continuous or discrete values related to edge types. For example, when considering a numerator as graph data, the edge type is a covalent bond, and the edge attribute represents the bond energy. When considering a circuit, the edge types are, for example, digital signals and analog signals, and the edge attributes represent voltage, current, or frequency. When considering a transportation network, the edge types are general roads and highways, and the edge attributes represent speed limits.
[0094] An edge ID is a unique number assigned to each edge. If we use the edge ID as the name of the edge, then, for example, if there are multiple edges in a single molecule, such as in the covalent bonds of a molecule, the unity cannot always be maintained; that is, there is a problem in that when one edge ID is selected, it cannot be assigned to a single edge.
[0095] While it's possible to address the lack of uniqueness in edges by renaming them, the method of renaming is arbitrary, offering flexibility. For example, for two edges with the same name, one can be given "_1" and the other "_2" to maintain uniqueness, or vice versa. In this case, when generating text representing the graph using natural language processing, edges with "_1" are more likely to be generated. This creates an inequality between edges. To resolve this inequality, text can be created by augmenting the data to change combinations, similar to how permutations work.
[0096] However, if, for example, there are 10 edges with the same edge name, there are 10 factorial permutations of combinations. Therefore, to represent the graph data as text containing edge IDs, it is necessary to create 10 factorial texts through data augmentation. In this way, as the number of edges increases, the number of texts created through data augmentation from a single graph data set increases exponentially, making it difficult to perform natural language processing on the created text data from the perspective of computational complexity or required memory. It becomes impossible to train natural language processing within a realistic time or cost.
[0097] Edge IDs are essential for graph management, but they hinder graph generation. Therefore, the graph natural language processing device 1 according to Embodiment 1 introduces edge tokens that combine edge type and edge attribute instead of edge IDs. Considering only edge type, there are often multiple edges with the same edge type, and similarly, there are often multiple edges with the same edge attribute, so they cannot be used as a substitute for edge IDs.
[0098] However, by combining edge types and edge attributes into a single word, and by adding edge types or edge attributes, the uniqueness of edges can be improved, thus serving as an alternative to edge IDs. For example, in the case of molecules, a covalent bond and bond energy can be considered a single edge, and this edge can be called an edge token. Edge tokens possess enough uniqueness to serve as a substitute for edge IDs.
[0099] Furthermore, by combining information such as the node order of the atoms at both ends of the edge, the sum of the node orders, or the node type, in addition to the bond energy, the unity of the edge tokens is improved, and they can serve as a substitute for edge IDs. This has the effect of allowing graphs to be represented without using edge IDs.
[0100] However, similar to node tokens, ensuring unity can be difficult with edge tokens alone. In contrast, even without unity, edges can be defined by their relative relationships with surrounding nodes, allowing them to be converted to text data without losing the characteristics of the graph data. That is, they are represented by a combination of a focus edge and a node token created by combining the node type and node attributes connected to the focus edge. This further improves unity by defining the relative relationships of edges, achieving an effect equivalent to edge IDs. Conversely, the above representation is redundant compared to defining a graph based on node IDs, node types, node attributes, edge IDs, edge types, or edge attributes and representing the graph in text. However, by combining edge types and edge attributes and defining edges relatively with edge tokens, edge IDs can be replaced.
[0101] Thus, when creating an edge token by combining edge type and edge attributes, in Embodiment 1, a colon ":" is used as a delimiter. However, if the edge type and edge attributes can be obtained from the edge token, the delimiter does not necessarily have to be used. These are the same as those explained in the node center configuration.
[0102] The node tokens and edge tokens created in this way are shown in their best form using a concrete example in Figure 3. Figure 3 is a simple graph composed of four edges and four other edges. A simple graph, in this context, is a graph that has zero or only one edge between any two edges, meaning that there are no more than two edges between any two edges, and that does not have self-loops where an edge leads from one node to the same node. In Embodiment 1, the term "graph" refers to a simple graph.
[0103] The graph in Figure 3 includes edges of edge type A and edge attribute 1000, edges of edge type B and edge attribute 1, edges of edge type B and edge attribute 10, edges of edge type C and edge attribute 100, edges of edge type e and edge attribute 1, edges of edge type e and edge attribute 10, edges of edge type f and edge attribute 1, and edges of edge type f and edge attribute 1.
[0104] For these edges, edge tokens are created by combining the edge type and edge attributes. Specifically, if the delimiter between the edge type and edge attribute is defined as a colon ":", the edge tokens will be "A:1000", "B:1", "B:10", and "C:100".
[0105] Furthermore, if we define the delimiter between edge type and edge attribute as a colon ":", the edge tokens become "e:1", "e:10", "f:1", and "f:1". In this case, since edge types and edge types do not contain numbers, and edge attributes and edge attributes consist only of numbers, it is not necessary to use a delimiter, but for clarity, we will use a delimiter in this explanation. Edge token "e:1" is connected to edge tokens "B:1" and "B:10", and edge token "e:10" is connected to edge tokens "B:10" and "C:100". Edge token "f:1" is connected to edge tokens "B:10" and "A:1000", and edge token "f:1" is connected to edge tokens "A:1000" and "C:100".
[0106] As a result, if we use a half-width space as the delimiter between edge tokens and between edge tokens, the edge-centered arrangement will look like this: e:1 B:1 B:10 e:10 B:10 C:100 f:1 B:10 A:1000 f:1 A:1000 C:100
[0107] For clarity, in Embodiment 1, edge tokens can be separated by line breaks and represented as follows: e:1 B:1 B:10 e:10 B:10 C:100 f:1 B:10 A:1000 f:1 A:1000 C:100
[0108] Even though there are two types of tokens—space delimiters and newline delimiters—each delimiter contains no information, so unnecessary delimiters can be removed from the generated text. On the other hand, this leads to an unnecessary increase in computational cost, so when dealing with natural language processing in graph natural language processing, it is desirable to replace newline delimiters with space delimiters.
[0109] In natural language processing, this half-width space or a delimiter that replaces a half-width space is used to separate text into edge tokens by a tokenizer, so that the training data handled by the learning model used for natural language processing does not contain the delimiter.
[0110] Furthermore, the edge tokens generated by the trained learner, or the edge tokens themselves, do not contain delimiters. Therefore, it is desirable to add delimiters to each generated edge token or edge token before converting them to text or a graph.
[0111] Thus, the text data created by the processing unit 14 includes three types of elements: node tokens, edge tokens, and delimiters. The delimiters are removed by a tokenizer used in natural language processing to extract words from a string. As a result, the generated text contains only two types of words based on node tokens and edge tokens. Consequently, the physical constraints for constructing the graph are preserved. Therefore, regardless of the order in which the node tokens and edge tokens are generated as text, the resulting text can be converted into a graph.
[0112] (Directed Edges) Embodiment 1 demonstrates that oriented edges can be represented as text in either a node-centered or edge-centered configuration. Figure 4 shows an example (2) of a graph network in Embodiment 1, illustrating a directed graph with oriented edges. The difference between Figure 4 and Figure 3 is that the edge from node token "C:100" to "B:10" has an orientation, and the edge from node token "C:100" to "A:1000" also has an orientation.
[0113] Furthermore, the edges between node tokens "B:10" and "B:1", and between node tokens "B:10" and "A:1000", can be considered bidirectional. This means that in the adjacency matrix, bidirectional edges have 1s at positions symmetrical with respect to the diagonal elements, while unidirectional edges have 1s at positions symmetrical with respect to the diagonal elements and 0s at positions symmetrical with respect to the diagonal elements. Since the edges in the undirected graph in Figure 3 and the bidirectional edges in the directed graph have the same meaning, these edges are identical in Figures 3 and 4. In this case, in the representation based on node centering, the node tokens are "A:1000", "B:1", "B:10", and "C:100". The edge tokens are "e:1", "e:10", "f:1", and "f:1", and by assigning source, sink, and bidirectional to one element of the edge attribute to represent the direction of the edge, it is possible to represent directed edges in text. In other words, for the direction in which an edge is moving out, for example from "C: 100" to "B: 10", "C: 100" is used as the source, and the source is added to the edge token "e: 10" to represent it as "e: [10, source]".
[0114] Furthermore, the direction in which an edge is coming in, for example, from "C:100" to "B:10", is represented as the edge token "e:[10, sink]", where "B:10" is the sink and the sink is added to "e:10". The same applies to bidirectional connections, where a bidirectional element is added to the edge attribute. As a result, the text in the node center arrangement in Figure 4 will be as follows: A:1000 f:[1, bidirectional] f:[1, sink] B:1 e:1[1, bidirectional] B:10 e:[1, bidirectional] e:[10, sink] f:[1, bidirectional] C:100 e:[10, source] f:[1, source]
[0115] For clarity, the nodes of interest, "A:1000", "B:1", "B:10", and "C:100", are shown on separate lines. However, it is desirable to input the data into a natural language processing tokenizer in the following format, by separating the nodes with the same delimiter as the delimiter used between the node token and edge token of the nodes of interest: A:1000 f:[1, bidirectional] f:[1, sink] B:1 e:1[1, bidirectional] B:10 e:[1, bidirectional] e:[10, sink] f:[1, bidirectional] C:100 e:[10, source] f:[1, source]
[0116] Also, for the sake of clarity, we have used words such as bidirectional, source, and sink, but you can also represent them as follows, for example, by setting bidirectional as "0", source as "1", and sink as "2": A: 1000 f: [1, 0] f: [1, 2] B: 1 e: 1 [1, 0] B: 10e: [1, 0] e: [10, 2] f: [1, 0] C: 100 e: [10, 1] f: [1, 1]
[0117] Furthermore, it can also be represented using an edge-centered configuration. The node tokens and edge tokens are the same as in the node-centered configuration, with the node tokens being "A: 1000", "B: 1", "B: 10", and "C: 100", and the edge tokens being "e: 1", "e: 10", "f: 1", and "f: 1".
[0118] In contrast to the node-centered arrangement, this method defines the order in which node tokens representing nodes adjacent to the edge token of interest are arranged. Since each edge token has two node tokens at both ends, the orientation is represented by designating one as the source and the other as the sink.
[0119] For example, if we define the node token of the first adjacent node as the source and the node token of the second adjacent node as the sink, the directed graph in Figure 4 can be represented as follows: e: [1, bidirectional] B: 1 B: 10 e: [10, unidirectional] C: 100 B: 10 f: [1, bidirectional] B: 10 A: 1000 f: [1, unidirectional] C: 100 A: 1000
[0120] For bidirectional connections, there is no distinction between source and sink, so the order can be freely chosen. For example, e:[1, bidirectional] B:1 B:10 can also be e:[1, bidirectional] B:10 B:1. Compared to a node-centered configuration, this representation allows us to reduce the number of edge token types from three (bidirectional, source, sink) to two (bidirectional, unidirectional) by fixing the order of the node tokens.
[0121] Furthermore, by dividing bidirectional signals into unidirectional ones as shown below, the number of types (unidirectional) can be reduced to one. e: [1, unidirectional] B: 1 B: 10 e: [1, unidirectional] B: 10 B: 1 e: [10, unidirectional] C: 100 B: 10 f: [1, unidirectional] B: 10 A: 1000 f: [1, unidirectional] A: 1000 B: 10 f: [1, unidirectional] C: 100 A: 1000
[0122] However, the former fixes the order of node tokens, while the latter fixes the order of node tokens and also increases the amount of text generated. Therefore, it is desirable to choose the method that best suits the characteristics of the dataset and the computational cost of the processing.
[0123] For example, in datasets with many bidirectional edges, it is better to represent them using the former two types (bidirectional and unidirectional). Conversely, in datasets with few bidirectional edges and many unidirectional edges, it is better to represent them using the latter single type (unidirectional). This allows for efficient graph natural language processing and improves the accuracy of graph generation.
[0124] Thus, unlike similar technologies such as graph neural networks, graph natural language processing has the unique characteristic of being able to adjust the degree of freedom of representation to suit the dataset, training environment, and inference environment.
[0125] Figure 5 shows an example (3) of a graph network in Embodiment 1, and displays a signed graph in which information about the edge's sign is assigned to one element of the edge attribute. As shown in Figure 5, a signed graph can be represented by assigning information about the edge's sign to one element of the edge attribute. A signed edge means that when a signal is propagated from one node to an adjacent node, the characteristics of the node are reversed. In a node-centered arrangement, it can be represented as follows: A: 1000 f: [+, bidirectional] f: [-, sink] B: 1 e: 1 [+, bidirectional] B: 10 e: [+, bidirectional] e: [-, sink] f: [+, bidirectional] C: 100 e: [-, source] f: [-, source]
[0126] Furthermore, in an edge-centered configuration, it can be represented as follows: e: [+, bidirectional] B: 1 B: 10 e: [-, unidirectional] C: 100 B: 10 f: [+, bidirectional] B: 10 A: 1000 f: [-, unidirectional] C: 100 A: 1000
[0127] Next, the hardware configuration for realizing the functions of the graph natural language processing device 1 will be described. The functions of the graph data acquisition unit 11, node extraction unit 12, edge extraction unit 13, and processing unit 14 of the graph natural language processing device 1 are realized by processing circuits. That is, the graph natural language processing device 1 includes processing circuits for executing the processes from step ST1 to step ST4 shown in Figure 2. The processing circuits may be dedicated hardware, but they may also be a CPU (Central Processing Unit) that executes programs stored in memory, or a GPU, TPU (Tensor Processing Unit), or NPU (Neural network Processing Unit) that executes programs and datasets stored in graphics memory. Next, the hardware configuration of the graph natural language processing device will be described with reference to Figures 2 and 3.
[0128] Figure 6 is a block diagram showing the hardware configuration for realizing the functions of the graph natural language processing device 1. Figure 7 is a block diagram showing the hardware configuration for executing the software that realizes the functions of the graph natural language processing device 1. In Figures 6 and 7, the graph data acquisition unit 11 acquires graph data from an external device or a storage unit (not shown in Figure 1) provided by the graph natural language processing device 1 via the input interface 100. The processing unit 14 outputs the created text data via the output interface 101 to an external natural language processing device or a natural language processing unit (not shown in Figure 1) provided by the graph natural language processing device 1.
[0129] If the processing circuit is a dedicated hardware processing circuit 102 as shown in Figure 6, the processing circuit 102 may be, for example, a single circuit, a composite circuit, a programmed processor, a parallel programmed processor, an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array), or a combination thereof. The graph data acquisition unit 11, node extraction unit 12, edge extraction unit 13, and processing unit 14 of the graph natural language processing device 1 may be implemented by separate processing circuits, or these functions may be implemented together by a single processing circuit.
[0130] When the processing circuit is the processor 103 shown in Figure 7, the functions of the graph natural language processing device 1, namely the graph data acquisition unit 11, node extraction unit 12, edge extraction unit 13, and processing unit 14, are realized by software, firmware, or a combination of software and firmware. The software or firmware is written as a program and stored in memory 104.
[0131] The processor 103 reads and executes a program stored in the memory 104, thereby realizing the functions of the graph data acquisition unit 11, node extraction unit 12, edge extraction unit 13, and processing unit 14 of the graph natural language processing device 1. For example, the graph natural language processing device 1 includes a memory 104 for storing a program that, when executed by the processor 103, will result in the execution of steps ST1 to ST4 shown in Figure 2. These programs cause the computer to execute the procedures or methods of processing performed by the graph data acquisition unit 11, node extraction unit 12, edge extraction unit 13, and processing unit 14. The memory 104 may be a computer-readable storage medium that stores a program for causing the computer to function as the graph data acquisition unit 11, node extraction unit 12, edge extraction unit 13, and processing unit 14.
[0132] Memory 104 includes, for example, non-volatile or volatile semiconductor memory such as RAM (Random Access Memory), ROM (Read Only Memory), VRAM, flash memory, EPROM (Erasable Programmable Read Only Memory), EEPROM (Electrically-EPROM) (registered trademark), magnetic disks, flexible disks, optical disks, compact disks, minidiscs, DVDs, etc.
[0133] Some of the functions of the graph data acquisition unit 11, node extraction unit 12, edge extraction unit 13, and processing unit 14 of the graph natural language processing device 1 may be implemented by dedicated hardware, while other parts may be implemented by software or firmware. For example, the function of the graph data acquisition unit 11 may be implemented by a processing circuit 102 which is dedicated hardware, and the functions of the node extraction unit 12, edge extraction unit 13, and processing unit 14 may be implemented by a processor 103 reading and executing a program stored in memory 104. In this way, the processing circuit can implement the above functions by hardware, software, firmware, or a combination thereof.
[0134] As described above, the graph natural language processing device 1 according to Embodiment 1 includes a graph data acquisition unit 11 that acquires graph data, a node extraction unit 12 that extracts nodes including node type and node attributes from the graph data, an edge extraction unit 13 that extracts edges including edge type and edge attributes from the graph data, and a processing unit 14 that outputs a node token formed by combining the node type and node attributes extracted by the node extraction unit 12, an edge token formed by combining the edge type and edge attributes extracted by the edge extraction unit 13, and text arranged with the node token and edge token. As a result, node IDs and edge IDs are not required, so the graph natural language processing device 1 can create text data from graph data without increasing the data volume by the number of different node IDs or edge IDs that would result from assigning node IDs or edge IDs.
[0135] In the graph natural language processing device 1 according to Embodiment 1, the text is a text in which node tokens and edge tokens of edges connected to the nodes of the node tokens are separated by a delimiter. As a result, node IDs and edge IDs are not required, so the graph natural language processing device 1 can create text data from graph data without augmenting the data by the number of different node IDs or edge IDs that would result from assigning node IDs or edge IDs.
[0136] In the graph natural language processing device 1 according to Embodiment 1, the text is a text in which edge tokens and node tokens of nodes connected to the edges of the edge tokens are separated by a delimiter. As a result, node IDs and edge IDs are not required, so the graph natural language processing device 1 can create text data from graph data without augmenting the data by the number of different node IDs or edge IDs that would result from assigning node IDs or edge IDs.
[0137] In the graph natural language processing device 1 according to Embodiment 1, one of the elements constituting the edge attribute has an edge orientation. This makes it possible to handle directed graphs in graph natural language processing.
[0138] In the graph natural language processing device 1 according to Embodiment 1, one of the elements constituting the edge attribute has the code of the edge. This makes it possible to handle code graphs in graph natural language processing.
[0139] The graph natural language processing device 1 according to Embodiment 1 uses a string that is not included in the string constituting the node type or node attribute, and that does not arise from the combination of node type and node attribute, as a first delimiter, and combines node type and node attribute using the first delimiter. As a result, a single delimiter is determined for separating node tokens and edge tokens, and the tokenizer in natural language processing can divide the string into individual node tokens and edge tokens.
[0140] In the graph natural language processing device 1 according to Embodiment 1, the first delimiter is a string that does not arise from a combination of node type, node attribute, edge type, and edge attribute. As a result, a single delimiter is determined for separating node tokens and edge tokens, and the tokenizer in natural language processing can split the string into individual node tokens and edge tokens.
[0141] The graph natural language processing device 1 according to Embodiment 1 uses a second delimiter that is not included in the string constituting the edge type or edge attribute, and that does not result from the combination of the edge type and edge attribute, and combines the edge type and edge attribute using the second delimiter. As a result, a single delimiter is determined for separating node tokens and edge tokens, and the tokenizer in natural language processing can divide the string into individual node tokens and edge tokens.
[0142] In the graph natural language processing device 1 according to Embodiment 1, the second delimiter is a string that does not arise from a combination of node type, node attribute, edge type, and edge attribute. As a result, a single delimiter is determined for separating node tokens and edge tokens, and the tokenizer in natural language processing can split the string into individual node tokens and edge tokens.
[0143] In the graph natural language processing device 1 according to Embodiment 1, the processing unit 14 replaces half-width spaces contained in node tokens with a first replacement character containing an empty string, replaces half-width spaces contained in edge tokens with a second replacement character containing an empty string, and sets the delimiter to a half-width space. This prevents the natural language processing tokenizer from splitting text data with unintended strings, and allows the use of a whitespace tokenizer.
[0144] In the graph natural language processing device 1 according to Embodiment 1, a node token representing an empty node is set for the other end of an edge to which a node is connected only at one end. This makes it possible to convert a graph network including edges to which a node is connected only at one end into text data.
[0145] In the graph natural language processing device 1 according to Embodiment 1, the graph data is a dataset in which identical node tokens are included in the graph network by changing the number of node type classifications or the number of significant digits of node attributes. This makes it possible to create strings that can be learned by natural language processing. Furthermore, by using the above dataset, it is possible not only to reduce the number of significant digits of node attributes but also to broadly consider node attributes with similar characteristics. For example, in the case of nationality, the number of node type classifications can be reduced by dividing them by area, such as North America, South America, Asia, the Middle East, Africa, and Europe.
[0146] In the graph natural language processing device 1 according to Embodiment 1, the graph data is a dataset in which the same edge token is included in the graph network by changing the number of classifications of edge types or the number of significant digits of edge attributes. This makes it possible to create strings that can be learned by natural language processing. Furthermore, by using the above dataset, it is possible not only to reduce the number of significant digits of edge attributes but also to broadly consider edge attributes that have similar characteristics. For example, in the case of a circuit, there are types of wiring such as power wiring, analog sensor wiring, digital sensor wiring, differential wiring, ground wiring, data communication wiring, high-speed and high-frequency wiring, low-speed and low-frequency wiring, and control wiring, but by broadly considering edge attributes, such as separating analog wiring from digital wiring, or separating signal wiring from power wiring or ground wiring, the number of edge types can be reduced.
[0147] In the graph natural language processing device 1 according to Embodiment 1, the graph data is a dataset in which two or more different node tokens are included in the graph network by changing the number of classifications of node types or the number of significant digits of node attributes. This makes it possible to create strings that can be learned by natural language processing.
[0148] In the graph natural language processing device 1 according to Embodiment 1, the graph data is a dataset in which two or more different edge tokens are included in the graph network by changing the number of classifications of edge types or the number of significant digits of edge attributes. This makes it possible to create strings that can be learned by natural language processing.
[0149] The graph natural language processing method according to Embodiment 1 includes: step ST1 in which a graph data acquisition unit 11 acquires graph data; step ST2 in which a node extraction unit 12 extracts nodes including node type and node attributes from the graph data; step ST3 in which an edge extraction unit 13 extracts edges including edge type and edge attributes from the graph data; and step ST4 in which a processing unit 14 outputs node tokens formed by combining the node type and node attributes extracted by the node extraction unit 12, edge tokens formed by combining the edge type and edge attributes extracted by the edge extraction unit 13, and text arranged with the node tokens and edge tokens. By executing the above method, the graph natural language processing device 1 can create text data from graph data without increasing the data volume by the number of different node IDs or edge IDs that result from the assignment of node IDs or edge IDs.
[0150] A computer executing the program according to Embodiment 1 functions as a graph data acquisition unit 11 that acquires graph data, a node extraction unit 12 that extracts nodes including node type and node attributes from the graph data, an edge extraction unit 13 that extracts edges including edge type and edge attributes from the graph data, a node token formed by combining the node type and node attributes extracted by the node extraction unit 12, an edge token formed by combining the edge type and edge attributes extracted by the edge extraction unit 13, and a processing unit 14 that outputs text arranged with the node token and edge token. This makes it possible to create text data from graph data without artificially inflating the data by the number of different node IDs or edge IDs that occur when assigning node IDs or edge IDs.
[0151] Embodiment 2. The graph natural language processing device according to Embodiment 2 extracts specific nodes from acquired graph data that match pre-set specific conditions, and generates text data based on the extracted graph data. The graph natural language processing device according to Embodiment 2 has the same components as the graph natural language processing device 1 shown in Figure 1, but the functions of each component differ as will be described later. The configuration of the graph natural language processing device according to Embodiment 2 will be described below with reference to Figure 1.
[0152] Figure 8 is a flowchart showing a graph natural language processing method according to Embodiment 2, illustrating a series of operations performed by the graph natural language processing device 1 according to Embodiment 2. The graph data acquisition unit 11 acquires graph data (step ST1A). For example, if an external server manages the graph data, the graph data acquisition unit 11 communicates with the external server via the communication unit and acquires the graph data received from the external server. The graph data acquired by the graph data acquisition unit 11 is output to the node extraction unit 12 and the edge extraction unit 13.
[0153] The node extraction unit 12 extracts specific nodes from the graph data acquired by the graph data acquisition unit 11 (step ST2A). Here, a specific node is a node that matches a predetermined set condition. The node extraction unit 12 determines whether or not a specific node exists in the graph shown by the graph data acquired by the graph data acquisition unit 11 (step ST3A).
[0154] (Specific Conditions) Specific conditions include, for example, whether a node possesses multiple pieces of information and is connected to an edge associated with each of these pieces of information. For example, the multiple pieces of information could be information indicating a directional node or information indicating nodes connected to both ends of a directional edge. Specifically, components such as diodes with two terminals or electrolytic capacitors with polarity can be treated as nodes with directionality in terms of rectification direction or polarity direction. Also, when representing a DC power supply with nodes, the direction of current flow can be assigned to the edges.
[0155] Furthermore, nodes connected to two or more edges may be extracted as specific nodes. For example, when semiconductors are represented by nodes, the graph natural language processing device 1 is pre-configured with the semiconductor's spec sheet information. The node extraction unit 12 determines the number of terminals of the semiconductor based on the spec sheet information and extracts specific nodes connected to multiple edges.
[0156] If a specific node exists in the graph (step ST3A; YES), the processing unit 14 creates multiple new nodes based on the multiple pieces of information that the specific node possesses, which have been extracted from the graph data by the node extraction unit 12 (step ST4A). For example, if the specific node is a node connected to the edges associated with each of the multiple pieces of information, the processing unit 14 creates multiple new nodes corresponding to each piece of information. Since the specific node can be described as a multi-terminal node with three or more terminals, the processing unit 14 creates the same number of terminal nodes as the number of terminals in the multi-terminal node.
[0157] The processing unit 14 connects edges to multiple new nodes (step ST5A). For example, the processing unit 14 connects edges that were previously connected to a specific node to the newly created nodes. In other words, the processing unit 14 changes the connections of edges connected to multi-terminal nodes from multi-terminal nodes to terminal nodes.
[0158] Furthermore, the processing unit 14 may create new edges to connect new nodes and connect multiple new nodes using the created edges. For example, the processing unit 14 may create a new edge and connect a node that was previously connected to a specific node to one of the multiple new nodes created via the edge.
[0159] Assume that a specific node has multiple pieces of information, including first information and second information, and is a node to which multiple edges are connected, including a first edge associated with the first information and a second edge associated with the second information. The processing unit 14 creates multiple edges, including a new edge in which one end is connected to the same destination as the first edge and the other end is connected to the first node corresponding to the first information, and a new edge in which one end is connected to the same destination as the second edge and the other end is connected to the second node corresponding to the second information.
[0160] Next, the processing unit 14 deletes unnecessary edges (step ST6A). For example, the processing unit 14 deletes edges that have become unnecessary due to the creation of multiple nodes. Specifically, the processing unit 14 deletes edges that are connected to a particular node.
[0161] Next, the processing unit 14 deletes the specific node (step ST7A). That is, the processing unit 14 creates the same number of terminal nodes as the number of terminals in a multi-terminal node with three or more terminals, changes the ends of the edges connected to the multi-terminal node to connections from the multi-terminal node to terminal nodes, and deletes the multi-terminal node. As a result, the original graph data is transformed into new graph data in which the specific node extracted by the node extraction unit 12 is replaced, with a subgraph having multiple new nodes and new edges connecting these new nodes to each other. In particular, if there is information about the terminals to which the edges connect, it is desirable that the edges connect to the terminal nodes that are the target of edge connections, which correspond to the terminals to which the connections exist. This makes it possible to preserve the connection relationships between terminals and edges as a graph, which was difficult to preserve as a graph in multi-terminal nodes.
[0162] If the processing up to step ST7A is completed, or if there is no specific node in the graph (step ST3A; NO), the node extraction unit 12 extracts the node type and node attributes from the graph data converted by the processing unit 14 (step ST8A). The edge extraction unit 13 extracts the edge type and edge attributes from the graph data converted by the processing unit 14 (step ST9A).
[0163] Next, the processing unit 14 creates a node token by combining the node type and node attribute extracted by the node extraction unit 12 as a single word (step ST10A). Subsequently, the processing unit 14 creates an edge token by combining the edge type and edge attribute extracted by the edge extraction unit 13 as a single word (step ST11A).
[0164] The processing unit 14 creates a token by combining a node token and an edge token with a delimiter (step ST12A). Next, the processing unit 14 creates text data by arranging the created tokens and outputs the created text data.
[0165] Next, the graph data in Embodiment 2 will be described. Figure 9 is a diagram showing an example of a graph network (1) in Embodiment 2, and shows the graph data that constitutes the graph network. First, the graph data acquisition unit 11 acquires the graph data shown in Figure 3. The node extraction unit 12 extracts nodes to which three or more edges are connected from the graph data shown in Figure 3. In Figure 3, a node in which node type B and node attribute 10 are combined is a specific node. Since this specific node is connected to three edges, it is assumed to have three pieces of information regarding the connections with the edges. The processing unit 14 creates three new nodes corresponding to each piece of information. As a result, the specific node is divided into three new nodes.
[0166] Since the node types of the newly created nodes are the same, the processing unit 14 may assign the node type of the specific node before the split to these nodes. Alternatively, the processing unit 14 may use domain knowledge to change the node type of the specific node before the split and assign the changed node type to the newly created nodes. Furthermore, the processing unit 14 may use domain knowledge to add, delete, or modify the node attributes of the specific node before the split and assign the processed node attributes to the newly created nodes. If there is no domain knowledge, the processing unit 14 may assign the same node attributes to the newly created nodes as before the split. The processing unit 14 may also assign the split node number or an element that replaces the number.
[0167] Furthermore, the new nodes obtained through the partitioning process can be identified by combining them with neighboring nodes as node tokens, just like the nodes included in the original graph data, without needing to assign any elements. For the sake of simplicity, we will assign node numbers to the nodes obtained through partitioning and identify the nodes using these node numbers. A node number is a unique identification number assigned to each node.
[0168] For example, as shown in Figure 9, if the node token string of a particular node is "B:10", the processing unit 14 divides this node to create new node tokens "B:10_1", "B:10_2", and "B:10_3" (notation (1)). This ensures that each node has different information.
[0169] Alternatively, node tokens such as “B: [10, 1]”, “B: [10, 2]”, and “B: [10, 3]” can be created by splitting a node attribute into two elements (notation (2)). In this case, it is desirable to match the number of elements for the unsplit node tokens, for example, by changing the string “A: 1000” to the string “A: [1000, None]”.
[0170] Hereafter, new nodes created by partitioning will be represented by notation (1). Furthermore, it is desirable to assign node numbers to new nodes according to certain conditions, such as the lexicographical order of adjacent node tokens. In Figure 9, the partitioned node adjacent to the node token whose string is "A: 1000" has the node number "_1" added. Similarly, the partitioned node adjacent to the node token whose string is "B: 1" has the node number "_2" added. And furthermore, the partitioned node adjacent to the node token whose string is "C: 100" has the node number "_3" added.
[0171] When assigning additional IDs, there is flexibility in how the IDs are assigned, so it is desirable to augment the data accordingly. Furthermore, if node terminal numbers are defined in addition to adjacent node tokens, node numbers may be assigned in order of terminal numbers. For example, when representing semiconductors with graph data, their terminal numbers are clear from the manufacturer's published spec sheet. Therefore, based on the spec sheet, the terminal numbers can be used as node numbers and assigned to node attributes.
[0172] The processing unit 14 connects the edges that were previously connected to specific nodes to the newly created nodes. Specifically, it connects node token "A:1000" and node token "B:10_1" with an edge, connects node token "B:1" and node token "B:10_2" with an edge, and connects node token "C:100" and node token "B:10_3" with an edge. As a result, as shown in Figure 9, the node tokens become "A:1000", "B:1", "B:10_1", "B:10_2", "B:10_3", and "C:100". The edge tokens become "B:10_2-B:1" and "B:10_1-A:1000".
[0173] As a result, the edge-centered layout can be represented by the following text: e:1 B:10_2 B:1 e:10 B:10_3 C:100 f:1 B:10_1 A:1000 f:1 A:1000 C:100
[0174] Furthermore, a node-centered configuration can be represented by the following text: A: 1000 f: 1, f: 1 B: 1 e: 1 B: 10_1 f: 1 B: 10_2 e: 1 B: 10_3 e: 10 C: 100 e: 10 f: 1
[0175] However, in a node-centered configuration, if the edge tokens connected to the divided node tokens are different, there is no need to assign IDs to the divided node tokens, thus eliminating the need for data augmentation. Therefore, node tokens "B:10", "B:10", and "B:10" are created from "B:10_1", "B:10_2", and "B:10_3".
[0176] For example, among terminal nodes of node tokens represented by two or more identical strings, the strings representing the edge tokens connected to the target terminal node may be different. Furthermore, the processing unit 14 may assign a node ID to the target terminal node among terminal nodes of node tokens represented by two or more identical strings. In Figure 9, since the edge tokens connected to the divided node tokens are different, it is not necessary to assign IDs to the divided node tokens, and they can be represented as follows. This representation has the special effect of not using the IDs of the divided nodes, i.e., eliminating the need for data augmentation, by assigning them to the node of interest instead of the IDs of the divided nodes. A: 1000 f: 1, f: 1 B: 1 e: 1 B: 10 f: 1 B: 10 e: 1 B: 10 e: 1 C: 100 e: 10 f: 1
[0177] As an example of graph data acquired by the graph natural language processing device 1 according to Embodiment 2, if node token "B:10" in Figure 3 represents a "company," and node tokens "A:1000," "B:1," and "C:100" represent "users," then in a graph showing that connections have been created between a company and multiple users, the node token "B:10" representing the company is connected to nodes representing multiple users via edges.
[0178] Users are interested in various aspects of the company represented by the node token "B:10" (e.g., products, profits, after-sales service, etc.). Therefore, by dividing the node token into nodes, each representing a different aspect of the company, and connecting each node to the user at an edge, it is possible to maintain a graph that matches the different aspects of the company. By dividing the token into the same number of nodes as the amount of information each node holds, each node can hold only one piece of information, resulting in the special effect of preventing information degradation.
[0179] On the other hand, as shown in Figure 3, when a node is created that holds multiple pieces of information in a single node, the aspects of the node cannot be preserved as graph data. This is also reflected in the text data (strings) created from the graph data, and can be considered as information degradation in which some of the information from the graph data is lost from the text data.
[0180] Figure 10 is a diagram showing an example (2) of a graph network in Embodiment 2, and shows a graph with multi-terminal nodes. The graph shown in Figure 10 is created by creating the same number of terminal nodes as the number of edges connected to a multi-terminal node that has connections to three or more edges, changing the ends of the edges connected to the multi-terminal node to connections from the multi-terminal node to terminal nodes, and deleting the multi-terminal node. In other words, the processing unit 14 creates the same number of terminal nodes as the number of edges connected to a multi-terminal node that has connections to three or more edges, changes the ends of the edges connected to the multi-terminal node to connections from the multi-terminal node to terminal nodes, and deletes the multi-terminal node.
[0181] For example, as shown in Figure 10, a multi-terminal node is connected to a node with one self-loop, one multi-edge with two edges, and two single edges. Therefore, it has six edges, including the two from the self-loop and the two from the multi-edge. The multi-terminal node is divided into six nodes, and the edges that are connected to the multi-terminal node are connected to the divided terminal nodes, respectively.
[0182] Furthermore, since the multi-terminal node 2 also has multiple edges composed of two edges, it is divided into two terminal nodes. For example, the processing unit 14 creates a multi-terminal node that has two or more edges between it and an adjacent node, and the same number of terminal nodes as the number of edges that make up the multiple edges, and changes the ends of the multiple edges that connect to the multi-terminal node to connections to the terminal nodes. As a result, since the edges connect to different terminals, the terminal information that the edges connect to can be retained in each terminal node. In this case, it is also acceptable to divide it into more terminal nodes than the number of edges, for example, if there are terminals that the edges do not connect to.
[0183] Furthermore, the node type and node attributes of these divided terminal nodes should be the same as those of the original multi-terminal node, and if they possess special information, they may be assigned as node tokens.
[0184] Furthermore, the same applies to edge tokens; since the edge tokens have the same configuration as before the split, it is not necessarily required to change the edge tokens. However, if the split results in special information, a new edge token may be used.
[0185] As mentioned above, when creating text from a graph divided into terminal nodes, it is desirable to represent the data in a node-centered arrangement to prevent unnecessary data padding. However, in the case of semiconductors, which have terminal numbers, there is only one way to assign node IDs, and data padding is unnecessary, so it is also desirable to represent the data in an edge-centered arrangement.
[0186] As described above, by dividing multi-terminal nodes, any graph can be transformed into a simple graph that does not have self-loops or multiple edges. Furthermore, simple graphs have the special effect of being able to be transformed into text without losing any information about the graph.
[0187] However, the above method divides the dataset into more nodes than there are edges, which can result in excessive division depending on the dataset. For example, it would result in excessive division for nodes with only one self-loop or only one multi-edge out of 100 terminals.
[0188] Figure 11 shows an example (3) of a graph network in Embodiment 2. In the example shown in Figure 11, nodes with multiple edges are divided into terminal nodes, and the divided nodes are connected by only one edge to transform the graph into a simple graph. At this time, the nodes connected to node 1 and node 2 are not divided. This reduces the number of nodes, thereby reducing the computational cost required for learning or inference. The computational cost includes computation time, memory usage such as RAM or VRAM, and power consumption.
[0189] Figure 12 shows an example (4) of a graph network in Embodiment 2. As shown in Figure 12, for nodes with self-loops, only the nodes related to the self-loop are divided into terminal nodes, and the nodes connected to nodes 1 and 2 are not divided, resulting in a simple graph.
[0190] For example, the processing unit 14 creates a multi-terminal node with a self-loop and twice the number of terminal nodes as the number of self-loops, and changes the connections of both ends of the self-loops connected to the multi-terminal node to connections of the terminal nodes. This not only prevents the loss of information about the nodes to which edges are connected when the graph is converted to text, but also reduces the number of terminal nodes, thereby lowering the computational cost required for learning and inference.
[0191] In Figures 10 to 12, the divided terminal nodes do not necessarily have to be connected. While the absence of connection results in insufficient graph data, the presence of a connection is evident from the strings constituting the node tokens or edge tokens, as these are represented as text. Therefore, the original single node can be reconstructed from the divided nodes. However, for example, if a specific divided node has terminals without edge connections, it cannot be represented using an edge-centered arrangement.
[0192] The processing unit 14 may provide one virtual node for each multi-terminal node and connect the terminal nodes via the virtual node. For example, the processing unit 14 may provide one virtual node for each multi-terminal node and connect the multi-terminal node and the terminal nodes via the virtual node. Figure 13 is a diagram showing an example (5) of a graph network in Embodiment 2, and shows a star graph transformation. In Figure 13, each node token "B:10_1", "B:10_2", and "B:10_3" are connected via the virtual node indicated by node token "B:10" through "B:10". When using virtual nodes, it is necessary to create new edge tokens. Tokens not included in other graphs, for example, "B:10" and "B:10_1" are connected by "edge:1", "B:10" and "B:10_2" are connected by "edge:2", and "B:10" and "B:10_3" are connected by "edge:3", and these edges are used for virtual nodes.
[0193] Furthermore, by combining node tokens corresponding to both ends of an edge, the edge token connecting B:10 and B:10_1 can be given the single name "B:10-B:10_1", the edge token connecting B:10 and B:10_2 can be given the single name "B:10-B:10_2", and the edge token connecting B:10 and B:10_3 can be given the single name "B:10-B:10_3", thereby processing them as special edges.
[0194] Figure 14 shows an example (6) of a graph network in Embodiment 2, illustrating a complete graph transformation. Furthermore, if the number of terminals to be divided is small, for example, five or fewer, a structure called a complete graph may be used, as shown in Figure 14, where the divided terminals are directly connected by edges without using virtual nodes. A complete graph has the advantage of clearly defining the relationships between nodes because the divided nodes are directly connected, and reducing the number of nodes because virtual nodes are not used. In this case, the example in Figure 13, with a node-centered arrangement, would result in the following text: A: 1000 f: 1, f: 1 B: 1 e: 1 B: 10 f: 1 b: 1 B: 10 e: 1 b: 2 B: 10 e: 10 b: 3 C: 100 e: 10 f: 1 B: 10 b: 1 b: 2 b: 3
[0195] Furthermore, with edge-centered placement, the text will be as follows: e:1 B:10_2 B:1 e:10 B:10_3 C:100 f:1 B:10_1 A:1000 f:1 A:1000 C:100 b:1 B:10 B:10_1 b:2 B:10 B:10_2 b:3 B:10 B:10_3
[0196] The text representation of the node-centered arrangement in the complete graph shown in Figure 14 is as follows, by not assigning node IDs to terminal nodes: A: 1000 f: 1, f: 1 B: 1 e: 1 B: 10 f: 1 b: 12 b: 31 B: 10 e: 1 b: 12 b: 23 B: 10 e: 10 b: 23 b: 31 C: 100 e: 10 f: 1
[0197] Furthermore, with edge-centered placement, it looks like this: e:1 B:10_2 B:1 e:10 B:10_3 C:100 f:1 B:10_1 A:1000 f:1 A:1000 C:100 b:12 B:10_1 B:10_2 b:23 B:10_2 B:10_3 b:31 B:10_3 B:10_1
[0198] When the number of nodes to be divided is three, the number of edges is "6" in both the star graph and the complete graph, and there is no difference between them. However, as the number of nodes to be divided increases, the star graph increases in number proportional to the increase in the number of nodes, while the complete graph has the disadvantage that the number of edges increases proportionally to the number of combinations of nodes, that is, approximately the square of the number of nodes. For example, when the number of nodes to be divided is 10, a complete graph requires 45 edge tokens, and when it is 100, a complete graph requires 4950 edge tokens, whereas a star graph can be represented with 100 edge tokens.
[0199] In graph natural language processing, divided nodes do not necessarily have to be connected, so it is desirable to use a star graph when the number of nodes is greater than, for example, "5". For example, if the number of nodes is "4", the number of edges in a star graph is "4", while the number of edges in a complete graph is "6". In a star graph, considering that the number of nodes increases by one, there is not a significant difference in the computational load or memory usage required for training. On the other hand, if the number of nodes is "5", the number of edges in a star graph is "5", while the number of edges in a complete graph is "10". Therefore, a complete graph has twice the number of edges as a star graph, and it is necessary to generate approximately twice as much text. This also increases the computational cost of natural language processing.
[0200] By replacing specific nodes with star graphs in this way, terminals without edge connections can also be retained as part of the graph data. Figure 15 shows an example (7) of a graph network in Embodiment 2. For example, as shown in Figure 15, it is possible to add a node such as “B:10-4” to the star graph in Figure 13, which is connected only to the virtual nodes of the star graph. The node order of the node token “B:10-4” is “1”. Taking a circuit as an example, the node tokens “B:10”, “B:10_1”, “B:10_2”, “B:10_3”, and “B:10_4” represent semiconductors, and “B:10_1”, “B:10_2”, “B:10_3”, and “B:10_4” represent terminals, among which “B:10_4” can represent an NC terminal.
[0201] When NC terminals are represented using the method shown in Figure 9, it is difficult to represent them using an edge-centered arrangement because no edges are connected to the NC terminals. In contrast, the methods shown in Figures 8 and 9 allow nodes with a node order of "1," such as NC terminals, to be converted into graph-natural language processing-compatible text data while retaining terminal information.
[0202] In Figure 15, the node tokens are "A:1000", "B:1", "B:10", "B:10_1", "B:10_2", "B:10_3", "B:10_4", and "C:100", and the edge tokens are "e:1", "e:10", "f:1", "f:1", "b:1", "b:2", "b:3", and "b:4". Therefore, the text for the node center configuration is as follows. A:1000 f:1, f:1 B:1 e:1 B:10 f:1 b:1 B:10 e:1 b:2 B:10 e:10 b:3 B:10 b:4 C:100 e:10 f:1 B:10 b:1 b:2 b:3 b:4
[0203] Furthermore, with edge-centered placement, the results are as follows: e:1 B:1 B:10_2 e:10 B:10_3 C:100 f:1 A:1000 B:10_1 f:1 A:1000 C:100 b:1 B:10 B:10_1 b:2 B:10 B:10_2 b:3 B:10 B:10_3 b:4 B:10 B:10_4
[0204] In a node-centered layout, if we allow the node of interest to have no edges, we can create text that includes NC terminals as follows: A: 1000 f: 1, f: 1 B: 1 e: 1 B: 10 f: 1 B: 10 e: 1 B: 10 e: 10 B: 10 C: 100 e: 10 f: 1
[0205] When text is generated that includes a node of interest that does not have an edge, it is not known that "B:10" has a characteristic. In this respect, "B:10" is removed as an unnecessary node. On the other hand, it can be retained as an NC terminal by showing the connection relationship between "B:10" and the "B:10" of other terminal nodes using a star graph or complete graph.
[0206] Thus, depending on the characteristics of the dataset, you may choose to leave the divided terminals unconnected, connect the divided terminals with a star graph, or connect the divided terminals with a complete graph. Furthermore, for a single graph or multiple graphs constituting a dataset, you may apply the three division methods to each node. That is, for one multi-terminal node, you may leave the divided terminals unconnected because it does not have an NC terminal, while for another multi-terminal node, you may connect the divided terminals with a star graph because it does have an NC terminal.
[0207] Figure 16 shows an example (8) of a graph network in Embodiment 2. Figure 17 shows an example (9) of a graph network in Embodiment 2. Figures 16 and 17 show a method of representing text for data that includes multi-terminal nodes with two or more identical node tokens in a single graph. Figure 16 is a representation method for a node-centered arrangement, showing how a multi-terminal node with two identical node tokens is divided into nodes for each terminal. There are two of each of the node tokens "n:1", "n:2", and "n:3", with "e:1" and "e:3" connected to the two "n:1"s, "e:1" and "e:3" connected to the two "n:2"s, and "e:2" and "e:3" connected to the two "n:3"s.
[0208] In this way, by combining node tokens and edge tokens, it is possible to represent two or more identical node tokens without adding node IDs or edge IDs. However, except when connecting identical node tokens, such as connecting two "n:3" nodes with "e:0", it is necessary to assign different edge tokens to the divided terminal nodes. For example, if both edge tokens connected to terminal node "n:1" are "e:1", the connection relationship becomes unclear. In such cases, it is desirable to assign an ID to the edge token, creating "e:1_1" and "e:1_2", and augment the data to compensate for the added ID. However, in most graphs, identical edges are rare, so they can be represented with minimal data augmentation.
[0209] In Figure 16, since different edge tokens are attached to two identical node tokens, the node center configuration is as follows: n:1 e:1 n:2 e:1 n:3 e:2 n:1 e:3 n:2 e:2 n:3 e:3
[0210] Figure 17 shows a representation method for edge-centered arrangement, characterized by assigning node IDs as node tokens to terminal nodes obtained by dividing a multi-terminal node. In particular, when terminal numbers are fixed, this method is superior to node-centered arrangement because it eliminates the need to augment data to resolve inequalities caused by assigning node IDs.
[0211] In Figure 17, since the terminal numbers are not yet determined, the terminal node on the left is assigned "ID: a" and the terminal node on the right is assigned "ID: b," and "_a" and "_b" are added to the respective node tokens. The resulting representation in edge-centered arrangement is as follows: e: 1 n: 1_a n: 2_a e: 2 n: 3_a n: 2_b e: 3 n: 1_b n_3_b
[0212] While we have shown how to split nodes connected to multiple edges, even a node connected to four edges, such as a carbon atom, does not need to be split if its terminals do not carry information; that is, if it doesn't matter which terminal a hydrogen atom is paired with or which terminal an oxygen atom is paired with. This is because it prevents information degradation when converting text data without terminal information to a graph structure representing the molecular structure.
[0213] Thus, in cases where there are two or more identical node tokens, a node-centered arrangement is desirable, such as by assigning attribute information to the edge tokens so that they become different edge tokens.
[0214] Next, a graph natural language processing device for directional nodes will be described with reference to Figure 18. Figure 18 is a diagram showing an example (10) of a graph network in Embodiment 2, and in terms of circuits, it shows directional nodes that correspond to diodes or DC power supplies. A diode has an anode and a cathode, and can pass a signal from the anode to the cathode as a forward bias characteristic, and a signal from the cathode to the anode as a reverse bias characteristic.
[0215] However, unlike circuit components that do not have a direction, such as resistors, forward bias characteristics and reverse bias characteristics are asymmetric with respect to voltage, and the output result differs depending on the direction of the input signal. Nodes with such characteristics are defined as directional nodes. Embodiment 2 shows methods for treating directional nodes as undirected graphs and methods for treating them as directed graphs.
[0216] First, in the case of an undirected graph, if many wires, as in a circuit diagram, have no direction, then it must be treated as a directed graph just for the diodes, which are few in number compared to the entire circuit, and generated with constraints on the order and number of edges. However, an undirected graph has the advantage of being able to be processed without constraints, and the methods of Embodiment 1 and Embodiment 2 can be used without changing them. The problem with directional nodes is that one node has two pieces of information, namely anode and cathode.
[0217] Therefore, the processing unit 14 divides the directional node into two nodes and assigns a different node type to each of the divided nodes. For example, the above problem is solved by dividing a directional node into two serial nodes and assigning a different node type, i.e., different information, to each of the divided nodes. In Figure 18, this corresponds to dividing node token A into node token "A: Sink" and node token "A: Source". Node token "A: Sink" and node token "A: Source" are connected by an edge. Furthermore, the edge that was connected to one end of node token A is connected to node token "A: Sink". The edge that was connected to the other end of node token A is connected to node token "A: Source".
[0218] In the node-centered configuration, “A e:1 e:2” in the left diagram of Figure 18 is represented in the right diagram as follows. This allows “A:Sink” and “B:Source” connected by an edge to be processed as having directionality from “A:Sink” to “B:Source”. Therefore, directional nodes can also be handled by the graph natural language processing unit 1. A:Sink e:1 e:0 B:Source e:0 e:1
[0219] Furthermore, in the edge-centered arrangement, e:1 A and e:2 A in the left diagram of Figure 18 are represented as shown below in the right diagram. This allows directional nodes to be handled by utilizing the features of graph natural language processing, as they can be processed as having directionality from A:Sink to B:Source when A:Sink and B:Source are generated at both ends of the edge of interest.
[0220] Conventionally, in order to handle directional nodes in a graph neural network, it is necessary to restrict the direction of edges in a directed graph that can process directed edges. The methods for processing directed graphs are limited compared to those for processing undirected graphs, and there are challenges in their application to graph generation, which remains unknown. Thus, graph natural language processing has a special effect that cannot be obtained with conventional methods: even when directed nodes are divided and treated as an undirected graph, the directionality of the nodes can be preserved. Furthermore, the processing unit 14 connects the two divided nodes in series and assigns node attributes or node types so that the two divided nodes become different node tokens. This makes it possible to treat a directed graph (directed nodes) as an undirected graph and to consider the forward and reverse directions of directed nodes.
[0221] Figure 19 shows an example of a graph network (11) in Embodiment 2. Figure 20 shows an example of a graph network (12) in Embodiment 2. Figures 19 and 20 show the case where more asymmetric directional nodes are handled in Figure 18. Compared to Figure 18, Figures 19 and 20 have the disadvantage that the divided nodes and the edges connecting them have a more complex structure, but they have the advantage that asymmetric directional nodes can be divided with high precision. Therefore, depending on the dataset, it is possible to choose to represent it in the same way as Figure 18, or in the same way as Figure 19 or Figure 20.
[0222] In Figure 19, the processing unit 14 connects the two divided nodes in parallel. Specifically, by connecting the two divided nodes in parallel, different paths are prepared for the outbound and return journeys, and the two divided nodes are connected in parallel by edges. Let one node token be A: Sink and the other node token be B: Source. In this case, the node type and node attribute are shown to be different, but as long as the divided node tokens do not have the same string, it is acceptable to change only the node type or only the node attribute.
[0223] In the node center arrangement shown in Figure 19, the left diagram is A e:1 e:2, while the right diagram is as follows: A e:1 e:3 e:5 B e:2 e:4 e:5
[0224] Furthermore, in the edge-centered configuration, the left diagram shows e:1 A, e:2 A, while the right diagram is as follows: e:1 A e:2 B e:3 A e:4 B e:5 A B
[0225] Furthermore, when using directed edges, it is desirable to use directed edges from one node to the other node in Figure 19, as shown in Figure 20. This allows for asymmetry between nodes, enabling the representation of nodes that are asymmetric with respect to direction, such as diodes, using a graph structure. As a result, learning through natural language processing is unnecessary, reducing the amount of data required for training and improving generation accuracy. In particular, when one direction is dominant, such as the forward and reverse directions of a diode, for example, if the forward direction is dominant, the forward direction is less affected by the reverse direction, so node token A: Sink in Figure 20 can be used, and conversely, the reverse direction is more easily affected by the forward direction, so node token A: Source in Figure 20 can be used to clarify the dependency.
[0226] Furthermore, although not shown in Figure 20, edge tokens e:1 to e:4 may be assigned a direction to the edges. Assigning an edge direction allows for an explicit division between forward and reverse directions. For example, if one of the above directions is dominant, then for the dominant A:Sink, e:1 would be the sink, e:3 the source, and e:5 the source, while for B:Source, e:2 the source, e:4 the sink, and e:5 the sink. This provides an unprecedented effect: the ability to represent asymmetric directional nodes as a graph structure.
[0227] As described above, in the graph natural language processing device 1 according to Embodiment 2, the processing unit 14 creates the same number of terminal nodes as the number of terminals of a multi-terminal node that has three or more terminals, changes the ends of the edges connected to the multi-terminal node to connections from the multi-terminal node to terminal nodes, and deletes the multi-terminal node. This makes it possible to convert it into a graph network that can retain terminal numbers.
[0228] In the graph natural language processing device 1 according to Embodiment 2, the processing unit 14 creates the same number of terminal nodes as the number of edges connected to a multi-terminal node that is connected to three or more edges, changes the ends of the edges connected to the multi-terminal node to connections from the multi-terminal node to terminal nodes, and deletes the multi-terminal node. This allows the graph to be converted into a graph network without multiple edges.
[0229] In the graph natural language processing device 1 according to Embodiment 2, the processing unit 14 creates multi-edge nodes that have two or more edges between them and adjacent nodes, and the same number of terminal nodes as the number of edges that form multi-edges, and changes the ends of the multi-edges connected to the multi-edge nodes to connections to the terminal nodes. This makes it possible to convert the graph network into one with a necessary and sufficient number of nodes without losing information about the multi-edges or creating unnecessary nodes.
[0230] In the graph natural language processing device 1 according to Embodiment 2, the processing unit 14 creates self-loop nodes having self-loops and terminal nodes twice the number of self-loops, and changes the connections of both ends of the self-loops connected to the self-loop nodes to connections to the terminal nodes. This makes it possible to convert into a graph network with a necessary and sufficient number of nodes without losing information about the self-loops and without creating unnecessary nodes.
[0231] In the graph natural language processing device 1 according to Embodiment 2, the processing unit 14 provides one virtual node for each multi-terminal node and connects the terminal nodes via the virtual node. This allows terminal nodes to be connected with a small number of edges.
[0232] In the graph natural language processing device 1 according to Embodiment 2, the processing unit 14 provides one virtual node for each multi-terminal node and connects the terminal node and the nodes from which the terminal node has been divided via the virtual node. In this way, by dividing nodes with multiple edges and nodes with self-loops into terminal nodes, the number of edges is reduced, and furthermore, the terminal node and the original node from which the terminal node was divided can be connected via the virtual node.
[0233] In the graph natural language processing device 1 according to Embodiment 2, among the terminal nodes of node tokens represented by two or more identical strings, the strings representing the edge tokens connected to the target terminal node are different. This has the effect of preventing mixing even if there are multiple multi-terminal nodes, multi-edge nodes, self-loop nodes, or terminal nodes created from each node in a single graph.
[0234] In the graph natural language processing device 1 according to Embodiment 2, the processing unit 14 assigns a node ID to the target terminal node among the terminal nodes of node tokens represented by two or more identical strings. This has the effect of preventing mixing of multiple multi-terminal nodes, multi-edge nodes, self-loop nodes, or terminal nodes created from each node, even if there are multiple multi-terminal nodes, multi-edge nodes, or self-loop nodes in a single graph.
[0235] In the graph natural language processing device 1 according to Embodiment 2, the processing unit 14 divides a directional node into two nodes and assigns a different node type to each of the divided nodes. This allows a directed graph (directed nodes) to be treated as an undirected graph.
[0236] In the graph natural language processing device 1 according to Embodiment 2, the processing unit 14 connects the two divided nodes in parallel. This allows a directed graph (directed nodes) to be treated as an undirected graph, and the forward and reverse directions of directed nodes can be considered.
[0237] In the graph natural language processing device 1 according to Embodiment 2, the processing unit 14 connects the two divided nodes in series and assigns a different node token to each node. This allows a directed graph (directed nodes) to be treated as an undirected graph, and the forward and reverse directions of directed nodes can be considered.
[0238] In the graph natural language processing device 1 according to Embodiment 2, the processing unit 14 connects two parallel-connected nodes with an edge. This allows a directed graph (directed nodes) to be treated as an undirected graph, and the forward and reverse directions of directed nodes can be considered.
[0239] In the graph natural language processing device 1 according to Embodiment 2, the edges between two divided nodes are unidirectional directed edges. This allows a directed graph (directed nodes) to be treated as an undirected graph, enabling consideration of both the forward and reverse directions of directed nodes, and improving the weight of only one direction (e.g., the forward direction).
[0240] Embodiment 3. In Embodiments 1 and 2, there is no fixed order for the node of interest and its adjacent edges, allowing for free rearrangement of strings from a single graph and thus enabling multiple representations. In contrast, the graph natural language processing device according to Embodiment 3 prescribes all possible arrangements in data augmentation in order to suppress the increase in data size that would result from data augmentation to eliminate inequality, given the degree of freedom in representation. The graph natural language processing device according to Embodiment 3 has the same components as the graph natural language processing device 1 shown in Figure 1, but the functions of each component differ as will be described later. The configuration of the graph natural language processing device according to Embodiment 3 will be described below with reference to Figure 1.
[0241] The node-centered configuration described up to Embodiment 2 is a string represented by one node token and multiple edge tokens, based on a combination of the node of interest and the edge adjacent to it. The edge-centered configuration is a string represented by one edge token and node tokens at both ends of the edge, based on a combination of the edge of interest and the node connected to that edge. Therefore, there is flexibility in the order of the node of interest and adjacent edges in the node-centered configuration, and in the order of the edge of interest and adjacent nodes in the edge-centered configuration. Node tokens are constructed by combining the node type and node attribute in the same order for all nodes in the graph data. That is, if there is one node type and one node attribute, for example, a node token is created by describing the node type first and then combining the node attribute. Also, if there are two node types and one node attribute, for example, a node token is created in the order of the first node type, the second node type, and the node attribute. As a result, node tokens for nodes with the same node type and the same node attribute in the same dataset are composed of the same string. Similarly, edge tokens are constructed by combining the edge type and edge attribute in the same order for all edges in the graph data. In other words, if there is one type of edge and one type of edge attribute, for example, an edge token is created by first describing the edge type and then concatenating the edge attribute. If there are two types of edges and one type of edge attribute, for example, an edge token is created in the order of the first edge type, the second edge type, and the edge attribute. As a result, edge tokens for edges with the same edge type and the same edge attribute in the same dataset will consist of the same string.
[0242] In the methods of Embodiment 1 or Embodiment 2, there is no fixed order for the nodes of interest and their adjacent edges, allowing for the free rearrangement of strings from a single graph, thus enabling multiple representations. However, allowing for flexibility in representation necessitates data augmentation to represent all possible arrangements of edge tokens in order to eliminate inequality.
[0243] (Adjacent Edges) There are four main ways to arrange edge tokens. You may use only one of these four methods, or you may combine two or more methods according to a predetermined order. The first method is based on the sum of the node degrees at both ends of the edge. Let's explain using Figure 3 as an example. The node tokens are A: 1000, B: 1, B: 10, C: 100. The edge tokens are e: 1, e: 10, f: 1, f: 1. The node center arrangement is represented as follows: A: 1000 f: 1 f: 1 B: 1 e: 1 B: 10 e: 1 e: 10 f: 1 C: 100 e: 10 f: 1
[0244] If node degrees A: 1000 is 2, B: 1 is 1, B: 10 is 3, and C: 100 is 2, then the f:1 of B: 10 and A: 1000 is 5, the e:10 of B: 10 and C: 100 is 5, the e:1 of B: 10 and B: 1 is 4, and the f:1 of B: 10 and A: 1000 is 5. That is, they are arranged in the order f:1 → e:10 → f:1 → e:1. As a result, the edge token of node token A: 1000 of the node in question becomes f:1 f:1, the edge token of node token B: 10 of the node in question becomes f:1 e:10 e:1, and the edge token of node token C: 100 of the node in question becomes f:1 e:10. Note that the edge tokens arranged in order of the sum of node degrees may correspond to node tokens or may be edge tokens included in the text.
[0245] Therefore, the text representing the graph is as follows: A: 1000 f: 1 f: 1 B: 1 e: 1 B: 10 f: 1 e: 10 e: 1 C: 100 f: 1 e: 10
[0246] This method takes into account that nodes with higher degrees tend to better represent the overall characteristics of the graph, and by summing the node degrees, it prioritizes edges that best represent the overall characteristics of the graph. This means that in graph generation, when generating graphs based on natural language processing, it is possible to generate them from nodes or edges that best represent the characteristics of the graph.
[0247] The second method is to sort the edges by the highest node degree at both ends. The node degrees are as follows: A: 1000 ⇒ 2, B: 1 ⇒ 1, B: 10 ⇒ 3, C: 100 ⇒ 2. In this case, the f:1 of B: 10 and A: 1000 is 3, the e:10 of B: 10 and C: 100 is 3, the e:1 of B: 10 and B: 1 is 3, and the f:1 of B: 10 and A: 1000 is 3, all of which are equal, so no sorting is done in Figure 5.
[0248] The string for node center placement is as follows: A: 1000 f: 1 f: 1 B: 1 e: 1 B: 10 e: 1 e: 10 f: 1 C: 100 e: 10 f: 1
[0249] This method, compared to the first method, can prioritize arranging edges directly connected to nodes that more easily represent the overall characteristics of the graph. This means that in graph generation, when generating graphs based on natural language processing, it is possible to prioritize the generation of areas around nodes that easily represent the overall characteristics of the graph. Note that the edge tokens arranged in order of maximum node degree may correspond to node tokens or may be edge tokens included in the text.
[0250] The third method is to arrange the edges in order of distance from the centroid node. For example, if A:1000 is the centroid node, then A:1000 is at a distance of 0, B:1 is at a distance of 2, B:10 is at a distance of 1, and C:100 is at a distance of 1. Therefore, the edge tokens are arranged in the order f:1 → f:1 → e:1 → e:10. Thus, the string for node center arrangement is as follows. This method has the advantage that the centroid node can be determined freely and can be done using the dataset and domain knowledge. A:1000 f:1 f:1 B:1 e:1 B:10 f:1 e:1 e:10 C:100 f:1 e:10
[0251] However, if domain knowledge is unavailable or the dataset lacks features, it is preferable to use the node token with the highest node degree as the centroid node. This is because, in many datasets, nodes connected to multiple other nodes tend to represent the overall graph's features. Thus, the centroid node's features, when combined with domain knowledge, can efficiently represent the graph, and they also have features that can be generated from important nodes and edges within the graph. The distance from the centroid node was calculated by adding a distance of 1 to each edge, but if each edge has a different distance, the edge's information may be used. The edge tokens sorted by distance from the centroid node may correspond to node tokens or may be edge tokens included in the text. Furthermore, nodes may also have distance information. In addition, distances may be negative values, not just positive values, for edges or nodes.
[0252] The fourth method is to arrange edge tokens in order of terminal number for node tokens that have terminal numbers. Figure 21 shows an example of a graph network in Embodiment 3. For example, if for node token B:10 the terminal number connected to the edge between C:100 is 1, the terminal number connected to the edge between B:1 is 2, and the terminal number connected to the edge between A:1000 is 3, then to arrange them in the order f:1 (between B:10 and A:1000) → e:1 → e:10 → f:1 (between A:1000 and C:100), the string for node center arrangement will be as follows: A:1000 f:1 f:1 B:1 e:1 B:10 f:1 e:1 e:10 C:100 e:10 f:1
[0253] Unlike the three methods described above, this method has the characteristic of being able to generate text that preserves the order of terminal numbers when generating text representing a graph based on natural language processing. The edge tokens that are arranged in order of terminal numbers may correspond to node tokens, or they may be edge tokens included in the text.
[0254] In each of the four methods described above—order by sum of node degrees, order by maximum node degree, order by distance from centroid node, and order by terminal number—the same edge tokens exist. In this case, multiple text representations can be conceivable from a single graph, and learning randomly arranged strings would require a massive amount of data.
[0255] Therefore, in order to recognize one text representation from one graph, we use a method of arranging edge tokens alphabetically based on whether the sum of their node degrees is equal, the maximum node degree is equal, the distance from the centroid node is equal, or the terminal number is equal. For example, considering the sum of node degrees, f:1 for B:10 and A:1000 is 5, e:10 for B:10 and C:100 is 5, e:1 for B:10 and B:1 is 4, and f:1 for B:10 and A:1000 is 5, so f:1, f:1 and e:10 are equal. For this reason, they are arranged alphabetically as e:10→f:1→f:1→e:1, and the strings with node center arrangement are as follows: A:1000 f:1 f:1 B:1 e:1 B:10 e:10 f:1 e:1 C:100 e:10 f:1
[0256] However, if the lexicographical order is common to all graphs, then arranging them in reverse order is also acceptable. Furthermore, instead of using the four methods described above, edge tokens can be arranged lexicographically from the beginning. In particular, for small graphs with an average of 10 or fewer nodes, the degree of representation is limited, so arranging them lexicographically, which requires less computation, has a special effect.
[0257] Furthermore, if there is sufficient computing resources or training time, it is desirable to augment the data by rearranging the order of edge tokens with the same conditions that are arranged lexicographically. For example, to augment the node center arrangement, the order of B:10 and C:100 can be rearranged, resulting in the following four possible representations: A:1000 f:1 f:1 B:1 e:1 B:10 e:10 f:1 e:1 C:100 e:10 f:1
[0258] A:1000 f:1 f:1 B:1 e:1 B:10 e:10 f:1 e:1 C:100 f:1 e:10
[0259] A:1000 f:1 f:1 B:1 e:1 B:10 f:1 e:10 e:1 C:100 e:10 f:1
[0260] A:1000 f:1 f:1 B:1 e:1 B:10 f:1 e:10 e:1 C:100 f:1 e:10
[0261] Furthermore, unlike data augmentation aimed at eliminating inequality, this data augmentation aims to improve the textual expressiveness of a single graph, and may involve simultaneously changing two or more node tokens or edge tokens to create a data augmented string. In this case, data augmentation in a node-centered configuration would look like this, for example: A: 1000 f: 1 f: 1 B: 1 e: 1 B: 10 e: 10 f: 1 e: 1 C: 100 e: 10 f: 1
[0262] A:1000 f:1 f:1 B:1 e:1 B:10 f:1 e:10 e:1 C:100 f:1 e:10
[0263] At this point, adjustments can be made, such as using only one method depending on the available computational resources. By augmenting the data in this way, it is possible to create a dataset that includes the representation methods of other nodes that have the same node token. This has the effect of allowing the similarity between target nodes in relation to the edges connected to other nodes that have the same node token to be passed as data to a natural language processing unit.
[0264] (Edges of Interest) Similar to adjacent edges, there are mainly four ways to arrange edge tokens. We will omit the explanation of the parts that are repeated with adjacent edges. Node tokens are represented as "A: 1000, B: 1, B: 10, C: 100". Edge tokens are represented as "e: 1, e: 10, f: 1, f: 1". The node center arrangement is represented as A: 1000 f: 1 f: 1 B: 1 e: 1 B: 10 e: 1 e: 10 f: 1 C: 100 e: 10 f: 1.
[0265] The node degrees are A: 1000 ⇒ 2, B: 1 ⇒ 1, B: 10 ⇒ 3, C: 100 ⇒ 2. Therefore, f:1 for B: 10 and A: 1000 is 5, e:10 for B: 10 and C: 100 is 5, e:1 for B: 10 and B: 1 is 4, and f:1 for B: 10 and A: 1000 is 5. That is, they are arranged in the order f: 1 → e: 10 → f: 1 → e: 1. As a result, we get the following: f: 1 B: 10 A: 1000 e: 10 B: 10 C: 100 f: 1 A: 1000 C: 100 e: 1 B: 1 B: 10
[0266] The second method is to sort the edges by the highest node degree at both ends. The node degrees are as follows: A: 1000 ⇒ 2, B: 1 ⇒ 1, B: 10 ⇒ 3, C: 100 ⇒ 2. Therefore, f: 1 for B: 10 and A: 1000 is 3, e: 10 for B: 10 and C: 100 is 3, e: 1 for B: 10 and B: 1 is 3, and f: 1 for B: 10 and A: 1000 is 3, all of which are equal, so no sorting is done. As a result, the string is as follows: e: 1 B: 1 B: 10 e: 10 B: 10 C: 100 f: 1 B: 10 A: 1000 f: 1 A: 1000 C: 100
[0267] The third method is to arrange the edges in order of distance from the centroid node. For example, if A:1000 is the centroid node, then A:1000 is at a distance of 0, B:1 is at a distance of 2, B:10 is at a distance of 1, and C:100 is at a distance of 1. Therefore, the edge tokens are arranged in the order f:1 → f:1 → e:1 → e:10, and the string for edge-centered arrangement is as follows: f:1 B:10 A:1000 f:1 A:1000 C:100 e:1 B:1 B:10 e:10 B:10 C:100
[0268] The fourth method is to arrange edge tokens in order of their terminal numbers for node tokens that have terminal numbers. As shown in Figure 21, for example, for a node token B:10, the terminal number connecting to the edge between C:100 is 1, the terminal number connecting to the edge between B:1 is 2, and the terminal number connecting to the edge between A:1000 is 3, then in order to arrange them in the order f:1 (between B:10 and A:1000) → e:1 → e:10 → f:1 (between A:1000 and C:100), the string for edge-centered arrangement is as follows: f:1 B:10 A:1000 e:1 B:1 B:10 e:10 B:10 C:100 f:1 A:1000 C:100
[0269] Similar to adjacent edges as described above, it is a desirable embodiment to arrange edge tokens with the same conditions in lexicographical order and allow only one text representation from a single graph. Alternatively, depending on the computing resources, a single graph may be represented by multiple texts created by rearranging edge tokens with the same conditions through data augmentation. That is, the processing unit 14 may augment the data by rearranging the order of edge tokens that have the same sum of node degrees, the same maximum node degree, the same distance from the centroid node, or the same terminal number.
[0270] (Adjacent Nodes) There are mainly two ways to arrange adjacent node tokens. You may use only one of these two methods, or you may combine the two methods according to a predetermined order.
[0271] The first method is to arrange them in order of node degree. The node tokens arranged in order of node degree may be node tokens within the text, or node tokens for each edge token. In Figure 3, the node tokens are A:1000, B:1, B:10, C:100, and the edge tokens are e:1, e:10, f:1, f:1. Therefore, the edge-centered arrangement is expressed as e:1 B:1 B:10e:10 B:10 C:100 f:1 B:10 A:1000 f:1 A:1000 C:100. The node degrees are A:1000⇒2, B:1⇒1, B:10⇒3, C:100⇒2, so arranging the node tokens in order of node degree results in B:10→A:1000→C:100→B:1. In this case, the string for the edge-centered arrangement is as follows. f:1 B:10 A:1000 e:10 B:10 C:100 f:1 A:1000 C:100 e:1 B:10 B:1
[0272] This method, considering that nodes with higher degrees tend to better represent the overall characteristics of the graph, involves summing the node degrees, which corresponds to prioritizing edges that better represent the overall characteristics of the graph. This takes into account the characteristics that are generated from elements that better represent the graph's features when generating graphs based on natural language processing.
[0273] The second method is to arrange the nodes in order of distance from the centroid node. The node tokens arranged in order of node degree can be node tokens within the text, or node tokens for each edge token. If A:1000 is the centroid node, then A:1000 is at a distance of 0, B:1 is at a distance of 2, B:10 is at a distance of 1, and C:100 is at a distance of 1. Therefore, the node tokens are arranged in the order A:1000 → B:10 → C:100 → B:1, and the string in edge-centered arrangement is as follows: f:1 A:1000 B:10 f:1 A:1000 C:100 e:1 B:10 B:1 e:10 B:10 C:100
[0274] The method for determining the centroid node is flexible and can be done using the dataset and domain knowledge. However, if domain knowledge is unavailable or the dataset lacks features, it is desirable to select the node with the highest node degree as the centroid node. This is because, in many datasets, nodes connected to multiple other nodes tend to represent the overall graph features. Thus, the features of the centroid node have the effect of efficiently representing the graph using domain knowledge. Furthermore, combining this with the aforementioned edge of interest is even more desirable, resulting in the unprecedented effect of being able to create a complete text from a single graph without data augmentation.
[0275] Similar to the example of adjacent edges, arranging node tokens lexicographically in the case of the edge of interest makes it easier to represent them as a complete text. Specifically, in the first method above, the node degrees are A: 1000 ⇒ 2, B: 1 ⇒ 1, B: 10 ⇒ 3, C: 100 ⇒ 2. Since the node degrees of node token A: 1000 and node token C: 100 are the same, they are arranged lexicographically in the order A: 1000 → C: 100. This results in node tokens in the order B: 10 → A: 1000 → C: 100 → B: 1. As a result, the string in edge-centered arrangement is as follows: f: 1 B: 10 A: 1000 e: 10 B: 10 C: 100 f: 1 A: 1000 C: 100 e: 1 B: 10 B: 1
[0276] However, if the lexicographical order is common to all graphs, then arranging them in reverse order is also acceptable. Alternatively, one can choose to arrange the node tokens in lexicographical order from the beginning without using the two methods described above. In particular, for small graphs with an average of 10 or fewer nodes, the degree of freedom in representation is limited, so arranging them in lexicographical order, which requires less computation, has a special effect.
[0277] In order to enhance the expressive power of the graph, it is also desirable in this embodiment for the processing unit 14 to augment the data by rearranging the order of node tokens whose sum of node degrees is equal or whose distance from the centroid node is equal. For example, if the nodes are arranged in alphabetical order as A:1000 → C:100, but the reverse order C:100 → A:1000 is created as data augmentation, the string created by data augmentation will be as follows. In this case, if there are sufficient computational resources, data augmentation may also be performed by changing two or more node tokens simultaneously. f:1 B:10 A:1000 e:10 B:10 C:100 f:1 A:1000 C:100 e:1 B:10 B:1
[0278] f:1 B:10 A:1000 e:10 B:10 C:100 f:1 C:100 A:1000 e:1 B:10 B:1
[0279] (Node of Interest) There are mainly two ways to arrange the node tokens of the node of interest. We will omit the explanation of parts that would be a repetition of the explanation of adjacent nodes. The first method is to arrange them in order of node degree. In Figure 3, the node tokens are "A: 1000, B: 1, B: 10, C: 100". The edge tokens are "e: 1, e: 10, f: 1, f: 1", so the edge center arrangement can be expressed as e: 1 B: 1 B: 10 e: 10 B: 10 C: 100 f: 1 B: 10 A: 1000 f: 1 A: 1000 C: 100. The node degrees are A: 1000 ⇒ 2, B: 1 ⇒ 1, B: 10 ⇒ 3, C: 100 ⇒ 2, so when the node tokens are arranged in order of node degree, it becomes B: 10 → A: 1000 → C: 100 → B: 1. In this case, the node center arrangement string will be as follows: B:10 f:1 e:10 e:1 A:1000 f:1 f:1 C:100 f:1 e:10 B:1 e:1
[0280] The second method is to arrange the nodes in order of distance from the centroid node. If A:1000 is the centroid node, then A:1000 is at a distance of 0, B:1 is at a distance of 2, B:10 is at a distance of 1, and C:100 is at a distance of 1. Therefore, the node tokens are arranged in the order A:1000 → B:10 → C:100 → B:1, and the string in the node-centered arrangement is as follows: A:1000 f:1 f:1 B:10 f:1 e:10 C:100 f:1 e:10 B:1 e:1
[0281] Similar to adjacent nodes, a complete text can be created from a single graph by arranging nodes with the same node degree or the same distance from the centroid node in lexicographical order. Combining this with the adjacent edges mentioned above yields even greater effectiveness. When arranged lexicographically, the strings at the node centers are as follows: B:10 f:1 e:10 e:1 A:1000 f:1 f:1 C:100 f:1 e:10 B:1 e:1
[0282] Furthermore, in data augmentation, it is possible to augment data under the same conditions as A:1000 → C:100 and C:100 → A:1000. Therefore, the following strings can be created, and it is desirable to adjust the amount of data augmentation according to the computing environment, or to create text with two or more node tokens changed simultaneously. Alternatively, a string with data augmentation can be created by changing two or more edge tokens simultaneously. B:10 f:1 e:10 e:1 A:1000 f:1 f:1 C:100 f:1 e:10 B:1 e:1
[0283] B:10 f:1 e:10 e:1 C:100 f:1 e:10 A:1000 f:1 f:1 B:1 e:1
[0284] Thus, Embodiment 3 has the characteristic that by determining the arrangement of the node of interest, adjacent nodes, edge of interest, and adjacent edges, and combining them, one unique text can be created from a single graph. Furthermore, by creating two or more texts from a single graph using node tokens or edge tokens with the same conditions, according to the environment such as computing resources, it becomes easier to convey the characteristics of a single graph to a natural language processing unit.
[0285] As described above, in the graph natural language processing device 1 according to Embodiment 3, node tokens are constructed by combining the node type and node attributes in the same order for all nodes in the graph data. This makes it possible to construct node tokens with the same string for nodes with the same node type and the same node attributes in the same dataset. Therefore, it is possible to prevent nodes with the same information from being generated in two different representations in graph natural language processing, thereby improving learning efficiency and graph generation efficiency.
[0286] In the graph natural language processing device 1 according to Embodiment 3, edge tokens are constructed by combining the edge type and edge attributes in the same order for all edges in the graph data. This makes it possible to construct edge tokens with the same string for edges with the same edge type and edge attributes in the same dataset. Therefore, it is possible to prevent the generation of edges with the same information in two different representations in graph natural language processing, thereby improving learning efficiency and graph generation efficiency.
[0287] The graph natural language processing device 1 according to Embodiment 3 arranges edge tokens for each node token in the order of the sum of the node degrees at both ends of the edge. This reduces the degree of freedom in the text representation of the graph, thereby reducing the amount of data augmentation required and enabling learning without increasing the amount of training data.
[0288] The graph natural language processing device 1 according to Embodiment 3 arranges edge tokens in the text in the order of the sum of the node degrees at both ends of the edge. This reduces the degree of freedom in the text representation of the graph, thereby reducing the amount of data augmentation required and enabling learning without increasing the amount of training data.
[0289] The graph natural language processing device 1 according to Embodiment 3 arranges the edge tokens for each node token in order of the maximum node degree at both ends of the edge. This reduces the degree of freedom in the text representation of the graph, thereby reducing the amount of data augmentation required and enabling learning without increasing the amount of training data.
[0290] The graph natural language processing device 1 according to Embodiment 3 arranges edge tokens in the text in order of the highest node degree at both ends of the edge. This reduces the degree of freedom in the text representation of the graph, thereby reducing the amount of data augmentation required and enabling learning without increasing the amount of training data.
[0291] The graph natural language processing device 1 according to Embodiment 3 arranges edge tokens for each node token in order of distance from the centroid node, which is one node in the graph data, to each edge. This reduces the degree of freedom in the text representation of the graph, thereby reducing the amount of data augmentation required and enabling learning without increasing the amount of training data.
[0292] The graph natural language processing device 1 according to Embodiment 3 arranges edge tokens in the text in order of the distance from the centroid node, which is a node in the graph data, to each edge. By reducing the degree of freedom in the text representation of the graph, the amount of data augmentation required is reduced, and learning can be performed without increasing the amount of training data.
[0293] The graph natural language processing device 1 according to Embodiment 3 arranges edge tokens in order of terminal numbers for node tokens that have terminal numbers. This reduces the degree of freedom in the text representation of the graph, thereby reducing the amount of data augmentation required and enabling learning without increasing the amount of training data.
[0294] The graph natural language processing device 1 according to Embodiment 3 arranges edge tokens in the text in order of terminal number relative to node tokens having terminal numbers. This reduces the degree of freedom in the text representation of the graph, thereby reducing the need for data augmentation and enabling learning without increasing the amount of training data.
[0295] The graph natural language processing device 1 according to Embodiment 3 sorts edge tokens alphabetically based on whether the sum of their node degrees is equal, the maximum node degree is equal, the distance from the centroid node is equal, or their terminal numbers are equal. This reduces the degree of freedom in the textual representation of the graph, thereby reducing the need for data augmentation and enabling learning without increasing the amount of training data.
[0296] In the graph natural language processing device 1 according to Embodiment 3, the processing unit 14 augments data by rearranging the order of edge tokens that have the same sum of node degrees, the same maximum node degree, the same distance from the centroid node, or the same terminal number. This increases the degree of freedom of the text representation of the graph within a controllable range, thereby improving the expressiveness of the training data.
[0297] The graph natural language processing device 1 according to Embodiment 3 arranges node tokens in the text in order of node degree. This reduces the degree of freedom in the text representation of the graph, thereby reducing the need for data augmentation and enabling learning without increasing the amount of training data.
[0298] The graph natural language processing device 1 according to Embodiment 3 arranges the node tokens for each edge token in order of node degree. This reduces the degree of freedom in the text representation of the graph, thereby reducing the amount of data augmentation required and enabling learning without increasing the amount of training data.
[0299] The graph natural language processing device 1 according to Embodiment 3 arranges node tokens in the text in order of their distance from the centroid node, which is a node in the graph data. This reduces the degree of freedom in the text representation of the graph, thereby reducing the need for data augmentation and enabling learning without increasing the amount of training data.
[0300] The graph natural language processing device 1 according to Embodiment 3 arranges the node tokens for each edge token in order of distance from the centroid node, which is a single node in the graph data. This reduces the degree of freedom in the text representation of the graph, thereby reducing the amount of data augmentation required and enabling learning without increasing the amount of training data.
[0301] The graph natural language processing device 1 according to Embodiment 3 arranges node tokens with the same node degree or the same distance from the centroid node in lexicographical order. This reduces the degree of freedom in the text representation of the graph, thereby reducing the need for data augmentation and enabling learning without increasing the amount of training data.
[0302] In the graph natural language processing device 1 according to Embodiment 3, the processing unit 14 augments data by rearranging the order of node tokens whose sum of node degrees is equal or whose distance from the centroid node is equal. This reduces the degree of freedom in the text representation of the graph, thereby reducing the amount of data augmentation required and enabling learning without increasing the amount of training data.
[0303] In the graph natural language processing device 1 according to Embodiment 3, the centroid node is the node with the highest node degree. This makes it possible to determine a single centroid node.
[0304] In the graph natural language processing device 1 according to Embodiment 3, the processing unit 14 creates a string with augmented data by modifying two or more node tokens or edge tokens. This allows for the extraction of many features from a single graph data, prevents the text from increasing due to data augmentation required for feature extraction, and enables natural language processing to be learned without increasing computational costs.
[0305] Embodiment 4. Embodiment 3 demonstrated data augmentation by changing the order of the node of interest and the edge of interest, and by changing the order of adjacent nodes and adjacent edges. In this case, since node tokens are created by combining node types and node attributes, no elements other than the combined node attributes appear for each node type. Therefore, the graph natural language processing device according to Embodiment 4 augments data by increasing the number of node tokens or edge tokens by changing the attribute information of the node tokens and edge tokens. The graph natural language processing device according to Embodiment 4 has the same components as the graph natural language processing device 1 shown in Figure 1, but the functions of each component differ as will be described later. The configuration of the graph natural language processing device according to Embodiment 4 will be described below with reference to Figure 1.
[0306] Graph data is less numerous than images or natural language data, and it is necessary to extract many features from a single graph data set. Therefore, Embodiment 3 demonstrates data augmentation by changing the order of the node of interest and the edge of interest, and the adjacent node and adjacent edge. However, since node tokens are created by combining node types and node attributes, elements other than the combined node attributes do not appear for each node type. Similarly, since edge tokens are created by combining edge types and edge attributes, elements other than the combined edge attributes do not appear for each edge type. Therefore, data augmentation is performed by increasing the number of node tokens or edge tokens by changing the attribute information of the node token or edge token. In other words, a method for increasing the number of node tokens or edge tokens is described in order to alleviate the conditions that have been narrowed down too much by using node tokens or edge tokens.
[0307] (Data augmentation based on node token attributes) A disadvantage of using node tokens that combine node types and node attributes is that, because elements that can become node attributes for a given node type are generated by natural language processing, combinations of node types and node attributes that are not included in the node token will not appear. For example, if you separately train a node type that is a car with the node attribute 50 km / h, and a node type that is a train with the node attribute 70 km / h, it is possible that the node type will be identified as a car and the node attribute as 70 km / h. However, because the node tokens are defined as car: 50 km / h and train: 70 km / h, car: 70 km / h will not be generated. This reduces the degree of freedom during generation based on natural language processing.
[0308] Therefore, the objective of Embodiment 4 is to improve the degree of freedom in graph representation that was reduced by node tokens. Specifically, by adding node tokens for car: 70 km / h and train: 50 km / h, and replacing text containing the node token car: 50 km / h with the node token car: 70 km / h, the expressive power of the graph is improved.
[0309] The first step involves a method of augmenting data using node tokens with modified node attributes. For example, the string for the node center based on Figure 5 of Embodiment 1 is as follows: B:10 f:1 e:10 e:1 A:1000 f:1 f:1 C:100 f:1 e:10 B:1 e:1
[0310] For example, considering node attribute A:100 which is different from node token A:1000, we can create the following new string by replacing A:1000 with A:100: B:10 f:1 e:10 e:1 A:100 f:1 f:1 C:100 f:1 e:10 B:1 e:1
[0311] Furthermore, if we also have B:3 in addition to B:1 and B:10, we can replace B:1 with B:3 to create the following new strings: B:10 f:1 e:10 e:1 A:100 f:1 f:1 C:100 f:1 e:10 B:3 e:1
[0312] This new string is created by replacing A:1000 with A:100 and B:1 with B:3. Unlike the data augmentation in Embodiment 1, which aims to eliminate inequality caused by the assignment of node IDs, Embodiment 4 is data augmentation aimed at improving the expressiveness of the graph. For this reason, a string may be created in which two or more node tokens are changed simultaneously.
[0313] Furthermore, while the data augmentation in Embodiment 2, which aims to eliminate the aforementioned inequalities, creates text representing the same graph, the data augmentation in Embodiment 3 differs in that it creates text representing different graphs. However, changing node attributes requires domain knowledge, and it is necessary to use appropriate node attributes for each node type and to make changes that are in line with the characteristics of the graph. For example, if the node type is "car" and the node attribute is "average speed," the average speed when driving on an ordinary road will be different from the average speed when driving on a highway, even for the same car. Therefore, the range of possible node attributes differs between a graph representing an ordinary road and a graph representing high speed, and it is necessary to change the node attributes to match the characteristics of the graph.
[0314] Therefore, in Embodiment 4, nodes of the same type but with different node attributes within the same graph are used. In the example above, node token B:1 and node token B:10 are of the same type but with different node attributes. In this case, the string obtained by replacing B:1 with B:10 is as follows: B:10 f:1 e:10 e:1 A:100 f:1 f:1 C:100 f:1 e:10 B:10 e:1
[0315] The string obtained by replacing B:10 with B:1 is as follows: B:1 f:1 e:10 e:1 A:100 f:1 f:1 C:100 f:1 e:10 B:1 e:1
[0316] The following strings are obtained by replacing B:1 with B:10 and B:10 with B:1. These can be used to augment the data as new strings. B:1 f:1 e:10 e:1 A:100 f:1 f:1 C:100 f:1 e:10 B:10 e:1
[0317] Furthermore, it is also desirable to extract nodes that are already included in the graph, have the same node type and node degree, but different node attributes, and then augment the data using those different node attributes. That is, the processing unit 14 augments the data by swapping node attributes for nodes that are the same node type, have the same node degree, and have different node attributes, or by duplicating specific node attributes to obtain node tokens. With this method, for example, in a dataset representing a highway, a node for a congested car has a node degree of "4" because there are cars in front, behind, and to the left and right. A node for a car that is not congested has cars in front and behind, or cars are sparsely distributed in front and behind. Therefore, the node degree will be "1" or "2", so similar node attributes can be extracted depending on the environment. By augmenting the data using different node attributes, an unprecedented effect can be obtained in which the creation of abnormal node tokens can be greatly reduced.
[0318] We have so far described edge-centered configurations with focus edges, but it is desirable to similarly augment the data for node tokens in node-centered configurations with adjacent edges. However, creating node tokens solely by swapping node attributes has the disadvantage that combinations of node types and node attributes cannot be freely generated. Therefore, we will show a method for changing node attributes in relation to node types. For example, if we consider a graph representing a transportation network using domain knowledge, and the car speed is between 30 km / h and 120 km / h, we will create node tokens with different values such as "car: 30 km / h" and "car: 50 km / h" in addition to "car: 100 km / h", and create text by replacing "car: 100 km / h" with these node tokens. By using this as training data during natural language processing training, the degree of freedom in natural language processing expression can be improved.
[0319] Furthermore, the processing unit 14 may augment the data by swapping node attributes between nodes of the same node type but different node attributes, or by duplicating specific node attributes to obtain node tokens. In other words, if there is sufficient graph data, data augmentation may be performed using node tokens that have been changed to the attribute values of nodes of the same node type but different node attributes. For example, if there is a car: 48 km / h in a graph or another graph, text can be created by replacing the node token of a car: 100 km / h in a different node or another graph with the node token of a car: 48 km / h. However, randomly swapping and augmenting data without domain knowledge may generate text that represents an abnormal graph. Therefore, as explained above, it is also desirable to augment the data by using the attribute values of nodes that are not only of the same node type but also of the same node order and have different node attributes. This reduces the possibility of an abnormal graph.
[0320] Furthermore, if sufficient text data is available, it is desirable to augment the data by utilizing domain knowledge and using attribute values of nodes that meet specific conditions based on adjacent node types and node attributes. It is also desirable to calculate the range or distribution of those node attribute values and augment the data based on that range or distribution. For example, if there are 100 node attributes of nodes of the same node type, and a bar graph with the 100 attribute values on the x-axis and the number on the y-axis follows a normal distribution, it is desirable to create node attributes that follow a normal distribution and augment the data with text containing those node attributes.
[0321] Data augmentation, also known as data extension, is a method to prevent overfitting by creating multiple data sets from a single data set, for example, by rotating, stretching (affine transformation), or partially extracting image data. In natural language processing, data augmentation can also be achieved by replacing words with synonyms or rearranging their order. Embodiment 4 is effective not only in preventing overfitting in this way, but also in improving the expressiveness of a single graph by creating node tokens. Furthermore, it has the effect of being able to augment data by a computably feasible amount.
[0322] (Data augmentation based on edge token attributes) A disadvantage of using edge tokens, which combine edge types and edge attributes, is that, similar to node tokens, elements that can become edge attributes are generated for each edge type through natural language processing, so combinations of edge types and edge attributes that are not included in the edge token will not appear. This reduces the degree of freedom during generation based on natural language processing. Therefore, Embodiment 4 aims to improve the degree of freedom of graph representation that has been reduced by edge tokens.
[0323] As a first step, one method is to augment the data using edge tokens with modified edge attributes. For example, the string for the edge center based on Figure 3 would be as follows: f:1 B:10 A:1000 e:10 B:10 C:100 f:1 A:1000 C:100 e:1 B:10 B:1
[0324] For example, considering a node attribute e:100 that is different from edge token e:10, replacing e:10 with e:100 will create a new string like the one below: f:1 B:10 A:1000 e:100 B:10 C:100 f:1 A:1000 C:100 e:1 B:10 B:1
[0325] Thus, unlike the data augmentation in Embodiment 1, which aims to eliminate inequality through the assignment of edge IDs, this method aims to improve the expressiveness of the graph. For this reason, a string may be created in which two or more edge tokens are changed simultaneously.
[0326] Furthermore, while data augmentation aimed at eliminating inequality creates text representing the same graph, the data augmentation in Embodiment 3 differs in that it creates text representing different graphs. Moreover, it is desirable to combine this with node token data augmentation, which can improve the expressiveness of a single graph and make it easier to capture the characteristics of the graph or multiple graphs using natural language processing. As a result, generation accuracy is improved, and it becomes possible to generate unprecedented graphs using natural language processing. However, modifying edge attributes requires domain knowledge, and it is necessary to have edge attributes that are appropriate for the edge type, and furthermore, modifications must be made according to the characteristics of the graph.
[0327] Therefore, in Embodiment 4, data augmentation is performed using edge tokens obtained by changing the edge attributes of nodes in the same graph that have the same edge type but different edge attributes. That is, the processing unit 14 augments data using edge tokens obtained by swapping edge attributes for edges that have the same edge type but different edge attributes, or by duplicating a specific edge attribute. In the above example, node tokens e:1 and e:10 are examples of edges that have the same edge type but different edge attributes. In this case, the string obtained by changing e:1 to e:10 and e:10 to e:1 will be as follows, and can be used to augment data as a new string. f:1 B:10 A:1000 e:1 B:10 C:100 f:1 A:1000 C:100 e:10 B:10 B:1
[0328] Unlike nodes, edges can know the nodes at both ends. For this reason, it is desirable to augment data using only edges that are of the same edge type, have the same node attributes at both ends, and have different edge attributes. For example, the processing unit 14 may augment data using edge tokens obtained by swapping edge attributes or duplicating specific edge attributes for edges that are of the same edge type, have the same node attributes at both ends, and have different edge attributes. Furthermore, data augmentation may be performed only using edges that have common node order or node attributes at both ends. In this way, data augmentation based on Embodiment 4 can be performed according to the dataset or computing resources.
[0329] However, creating edge tokens solely by swapping edge attributes in this way has the disadvantage of not allowing for the free generation of combinations of edge types and edge attributes. Therefore, similar to data augmentation of node tokens, edge attributes may be changed relative to the edge type. For example, the range or distribution of edge attribute values can be calculated, and data augmentation can be performed based on that range or distribution.
[0330] While data augmentation of node tokens and edge tokens has been explained separately, data augmentation may also be performed by simultaneously changing one or more node tokens and edge tokens in text. Furthermore, combining this with the data augmentation of Embodiment 2 can improve the expressiveness of the graph obtained from a single graph, making it a desirable embodiment. This feature utilizes the characteristics of graphs; for example, swapping pixels in an image or overlaying another image may result in an abnormal image, and swapping words in natural language may result in a sentence that is no longer correct. Therefore, domain knowledge is required for swapping. In contrast, Embodiment 4 utilizes the characteristic that, although graphs have relationships with adjacent nodes or edges, the relationships with adjacent information are weaker compared to images or natural language, and that swapping is less likely to result in an abnormal graph.
[0331] As described above, in the graph natural language processing device 1 according to Embodiment 4, the processing unit 14 augments the data with node tokens whose node attributes have been modified. This makes it possible to increase the amount of data using domain knowledge.
[0332] In the graph natural language processing device 1 according to Embodiment 4, the processing unit 14 augments data by swapping node attributes for nodes of the same node type but with different node attributes, or by duplicating specific node attributes to obtain node tokens. This allows the data to be increased using domain knowledge.
[0333] In the graph natural language processing device 1 according to Embodiment 4, the processing unit 14 augments data by swapping node attributes for nodes of the same node type, the same node order, and different node attributes, or by duplicating specific node attributes to obtain node tokens. This allows the data to be increased using domain knowledge.
[0334] In the graph natural language processing device 1 according to Embodiment 4, the processing unit 14 augments the data with edge tokens whose edge attributes have been modified. This allows the data to be increased using domain knowledge.
[0335] In the graph natural language processing device 1 according to Embodiment 4, the processing unit 14 augments data by swapping edge attributes for edges of the same edge type but with different edge attributes, or by duplicating specific edge attributes to obtain edge tokens. This allows the data to be increased using domain knowledge.
[0336] In the graph natural language processing device 1 according to Embodiment 4, the processing unit 14 swaps edge attributes for edges with the same edge type, the same node attributes for the nodes connected to both ends of the edge, and different edge attributes, or augments the data with edge tokens obtained by duplicating specific edge attributes. This makes it possible to increase the amount of data using domain knowledge.
[0337] Embodiment 5. The graph natural language processing device according to Embodiment 5 applies a graph network to a circuit. Note that the graph natural language processing device according to Embodiment 5 includes the same components as the graph natural language processing device 1 shown in FIG. 1, but the functions of each component are different as will be described later. Hereinafter, the configuration of the graph natural language processing device according to Embodiment 5 will be described with reference to FIG. 1.
[0338] The utilization of the graph natural language processing device according to Embodiment 5 in a circuit will be described. FIG. 22 is a circuit diagram showing the circuit to be processed in Embodiment 5. The circuit shown in FIG. 22 has a model number of "LTM805a" and shows a semiconductor having six terminals from X 1-1 to X 1-6 This semiconductor terminal X 1-1 is connected to an AC power supply V 1 and a capacitor C 1 with a capacitance of 1 μF is connected in parallel with the AC power supply V 1 Also, the terminals X of the semiconductor 1-2 and the terminal X 1-3 are short-circuited. A cathode terminal of a diode D 1-4 with a model number of "1N914" is connected to the terminal X 1 The terminal X 1-5 is a feedback terminal, and the cathode terminal of the diode D 1 a capacitor C with a capacitance of 1 μF 2 and a resistor R 1 with a resistance value of 10 Ω are connected. The ground is connected to the terminal X 1-6 The ground potential is the reference potential of the circuit.
[0339] The graph data acquisition unit 11 acquires graph data for the above circuit in which circuit components and ground are represented as nodes and wiring is represented as edges. For example, the graph data acquisition unit 11 acquires graph data in which the type of circuit component is the node type and the circuit constant or the circuit model number is the node attribute. Figure 23 is a diagram showing an example (1) of a graph network in Embodiment 5, and is a graph representation of the circuit in Figure 23. As shown in Figure 23, each node is assigned a node token. Ground GND does not have a node attribute, and the node token is composed only of the node type.
[0340] For example, when dividing the ground GND into frame ground FG and signal ground SG, the node attribute of frame ground FG is set to "0" and the node attribute of signal ground SG is set to "1". The processing unit 14 represents the node token of frame ground FG as the string "GND:0" and the node token of signal ground SG as the string "GND:1". This makes it possible to represent circuits using different grounds GND with node tokens.
[0341] Grounds are connected by wiring constrained by the physical dimensions of circuit components such as capacitors, resistors, or coils, or by residual inductance or parasitic capacitance, or by the circuit board structure. Alternatively, grounds may be connected to a metal enclosure or earth. Grounds may also be nodes connected via circuit components or parasitic elements. When separating grounds, the aforementioned wiring or circuit board structure must be considered.
[0342] In Figure 23, AC power supply V 1 It does not have node attributes. However, if the power supply is a DC power supply, the DC voltage or maximum rated current can be set as the node attribute. If it is an AC power supply, the voltage amplitude, frequency, or maximum rated current may be set as the node attribute.
[0343] Furthermore, in the case of a power supply having both DC and AC components, the two can be separated by representing the node type as DC power supply (e.g., VDC) and AC power supply (e.g., VAC). However, for multiple datasets representing special power supplies, such as AC power supplies with DC bias, both DC and AC power supplies may be included as node attributes. For example, strings representing the amplitude of a DC power supply and the amplitude of an AC power supply can be connected with a comma. This allows the node token to be represented as V:[1V,0V] for DC power supplies, V:[0V,1V] for AC power supplies, and V:[1V,1V] for AC power supplies. Additionally, the frequency of a power supply can be represented as V:[10V,60Hz] for example, 10V,60Hz.
[0344] As long as it can be represented as a node token in this way, it doesn't matter whether it's represented as a node type or a node attribute. This utilizes a feature of graph natural language processing that allows different node tokens to be processed as having different characteristics.
[0345] On the other hand, when treating circuits as conventional graph neural networks, the results obtained differ significantly depending on whether they are treated as node types or node attributes, requiring adjustments for each dataset. Therefore, using graphs in natural language processing has the advantage of eliminating the need for such adjustments that were previously required. However, it is undesirable for at least one token to appear at least twice in both the training data and the inference data.
[0346] The subdivision needs to be adjusted so that at least one node token or edge token appears two or more times. For example, if adjustment is difficult, or if there are sufficient computational resources for the dataset, data augmentation can be used to make node tokens or edge tokens that appear only once appear two or more times. This is because training or inference cannot be performed on tokens that are used only once or never appear.
[0347] If node tokens or edge tokens become too fragmented, it is desirable to reduce the number of significant digits in the node attribute or edge attribute as described in Embodiment 1, or to reduce the number of elements in the node attribute or edge attribute. Furthermore, if necessary, node tokens or edge tokens may be constructed using only node types or edge types, without using node attributes or edge attributes.
[0348] However, if it is difficult to reduce the number of node tokens or edge tokens, text data with the same tokens can be created by augmenting the node tokens or edge token nodes as described above. For this reason, if computable, it is desirable to augment the data without causing any loss of information.
[0349] In the circuit shown in Figure 22, there are two node tokens C:1u. Using the node ID, each capacitor is C 1 , C 2 It is possible to make the natural language processing unit recognize it as a different circuit component. However, in that case, as in Embodiment 1, the respective node IDs are swapped, C 1 , C 2 C 2 , C 1 Even texts like that need to be created by inflating the data in order to eliminate inequality.
[0350] In contrast, Embodiment 5 demonstrates that even if C:1u exists, the relationship between each C:1u and the surrounding nodes allows C:1u to have characteristics close to a unique node ID. As a result, data augmentation is unnecessary, and thus it has the unprecedented feature of being able to utilize natural language processing.
[0351] In the graph in Figure 23, semiconductor X:LTM805a has a self-loop, and the node tokens at both ends of the self-loop are semiconductor X:LTM805a. Therefore, the text in the node center arrangement according to Embodiment 1 is as follows. V e:1 e:2 e:3 e:4 e:16 e:19 C:1u e:3 e:4 e:5 e:6 e:20 e:21 X:LTM805a e:1 e:2 e:5 e:6 e:7 e:8 e:9 e:10 e:11 e:12 e:13 D:1N914 e:8 e:9 e:14 e:15 C:1u e:10 e:11 e:16 e:17 e:18 e:21 R:10 e:12 e:13 e:15 e:17 e:18 e:19 e:20
[0352] Furthermore, according to Embodiment 3, it is also desirable to define the order of node tokens or edge tokens and represent the graph in text. By representing it in this way, even if C:1u itself is not single, it can be seen that there are two C:1u, and that it is a different capacitor from the edge token adjacent to C:1u. The text in the edge-center arrangement is as follows. e: 1 V X: LTM805a e: 2 V X: LTM805a e: 3 V C: 1u e: 4 V C: 1u e: 5 X: LTM805a C: 1u e: 6 e:8 X:LTM805a D:1N914 e:9 X:LTM805a D:1N914 e:10 X:LTM805a C:1u e:11 X: LTM805a R: 10 e: 14 D:1N914 C:1u e:15 D:1N914 R:10 e:16 C:1u V e:17 C:1u R:10 e:18 C:1u R:10 e:19 V R:10 e:20 C:1u R:10 e:21 C:1u C:1u
[0353] In this edge-centered arrangement, it is impossible to know how many C:1u nodes are included in the graph. This is because the graph is not a simple graph, but contains multiple self-loops and multiple edges. One cause of multiple multiple edges is ground edges, and the number of multiple edges can be reduced by treating ground edges as ground nodes. For example, the processing unit 14 may output text consisting of node tokens, excluding ground nodes that represent the ground.
[0354] Figure 24 shows an example (2) of the graph network in Embodiment 5, and shows a graph in which ground edges are replaced with ground nodes. That is, it is a graph in which circuit components and ground are nodes, and wiring excluding ground is represented as an edge. In the graph of Figure 23, there are seven multi-edges and one self-loop, but in the graph with the addition of ground nodes in Figure 24, there is one multi-edge and one self-loop, resulting in a significant reduction in multi-edges while retaining essential ground information for the circuit. By adding ground nodes in this way, the following text is generated in a node-centered arrangement. V e:1 e:2 e:13 C:1u e:2 e:3 e:14 X:LTM805a e:1 e:3 e:4 e:5 e:6 e:7 e:8 e:9 D:1N914 e:5 e:6 e:10 e:12 C:1u e:8 e:11 e:12 e:15 R:10 e:7 e:10 e:11 e:16 GND e:9 e:13 e:14 e:15 e:16
[0355] Furthermore, the following applies to edge-centered placement: e:1 V X:LTM805a e:2 V C:1u e:3 X:LTM805a C:1u e:4 X:LTM805a e:7 X:LTM805a R:10 e:8 e:14 C:1u GND e:15 C:1u GND e:16 R:10 GND
[0356] By representing it in this way, for example, we can see that for edge token C:1u, two 1μF capacitors are connected to the ground node at e:14 and e:15. Therefore, we can see that it has two or more capacitors, and it also has the effect of creating a graph from text.
[0357] Unlike image or natural language processing, graph data, including circuits, is often not readily available for training in natural language processing. For example, with images or photographs, tens of thousands to tens of millions of data points are easily obtainable, and several petabytes of data can be used for training in natural language processing. In contrast, with graph data, at most tens of thousands of data points are available, and in some cases only a few. Furthermore, while there are single graphs with hundreds of millions of nodes, or graph datasets with multiple graphs, such as inorganic compounds, the amount of data is orders of magnitude smaller compared to images or natural language.
[0358] Furthermore, depending on the data, training may be required using only one large graph network (for example, a graph network representing a social network or a road traffic network), and it may be necessary to extract more features from a single data set compared to images or natural language. Therefore, in Embodiment 5, domain knowledge is used to augment the graph data. In this case, the augmentation is not to eliminate the inequality created by assigning node IDs, but rather to make it easier to extract features from the graph data. The former, which augmentes data to eliminate inequality, creates multiple texts from the same graph data, whereas the latter, which augmentes data to make it easier to extract features from the graph data, creates multiple texts from graph data with at least one different node type or node attribute.
[0359] Furthermore, the former allows for modification of one part of a single text to eliminate inequality, while the latter, which enhances the expressiveness of the data, allows for the creation of different text data from two or more parts of a single text. Additionally, the former is a data augmentation technique that creates multiple texts from a single graph, while the latter is a data augmentation technique that creates multiple texts from different graphs.
[0360] Embodiment 5 uses data augmentation of node attributes to enhance the expressive power of graph data. Generally, changing node types is likely to result in non-functional circuits, but changing node attributes allows for settings that make the circuit more likely to operate. Specifically, data augmentation by changing node attributes related to passive components of a circuit makes it less likely for abnormal circuits to occur. For example, changing the capacitance of a capacitor connected in parallel with a DC power supply from 1 μF to 33 μF has little effect on the normal operation of the circuit, so data augmentation is possible.
[0361] Furthermore, data inflation is possible not only for passive components with circuit constants, but also for components other than those with constants. For example, replacing a diode with a model number with a diode of the same type, or replacing a capacitor with a model number that has similar voltage ratings or frequency characteristics, makes it difficult to create an abnormal circuit, and thus allows for data inflation. The same applies to resistors, coils, and other components besides diodes and capacitors.
[0362] Furthermore, although domain knowledge is required, it is desirable to change the boost or buck inductor in power supply circuits, or to replace active components with similar active components. In particular, with regard to semiconductors, since semiconductors with identical terminal arrangements and similar characteristics are often manufactured by different manufacturers from a component procurement perspective, it is easy to inflate data for general-purpose semiconductors.
[0363] Furthermore, in addition to changing node attributes, it is also desirable to add new nodes and edges to connect individual circuit components to represent parasitic components such as residual resistance, residual inductance, and parasitic capacitance. In other words, the processing unit 14 may augment the data by creating a graph network of equivalent circuits that include the parasitic components of circuit components. Alternatively, the processing unit 14 may augment the data by creating a graph network of equivalent circuits that include the relationships between circuit components, between circuit components and wiring, between wirings, and parasitic capacitance or residual inductance. Specifically, for example, since a resistor has a residual inductance component in series with its resistance value and a parasitic capacitance component in parallel with its resistance value, data augmentation is possible by adding a node token representing residual inductance in series with the node token representing resistance, and by adding a node token representing parasitic capacitance in parallel with the node token representing the resistance node. It is also desirable to add the augmented graph to the training data after determining that it can be computed using a physical simulator such as a circuit simulator.
[0364] Thus, even when parasitic components are added, the circuit does not become an abnormal circuit because it is based on the actual characteristics of the circuit components, making it a desirable method of data augmentation. Furthermore, it has the effect of providing a circuit with characteristics close to the actual ones for circuits with high operating frequencies of several MHz or more, while not affecting circuits with low operating frequencies. Parasitic components may include not only individual circuit components, but also parasitic capacitance or mutual inductance components that occur between circuit components, between circuit components and wiring, or between wirings. When a voltage is applied to a circuit component, the effect of parasitic capacitance between the component and surrounding conductors or other circuit components with different potentials becomes apparent.
[0365] Furthermore, when current flows through a circuit component, mutual inductance is generated in the surrounding conductors or the circuit component itself. Magnetic coupling induces an electromotive force in the surrounding conductors, while simultaneously suppressing the current in the target conductor. Such parasitic capacitance and mutual inductance not only do not create abnormal circuits, but are also a desirable method of data augmentation, similar to individual circuit components. Moreover, it can provide circuits with characteristics close to the actual values for circuits with high operating frequencies of several MHz or more, while having no effect on circuits with low operating frequencies. Adding these parasitic components requires changing the number of nodes in the graph network, which in turn increases or decreases the number of node tokens or edge tokens. However, it is also desirable to change the structure of the graph through data augmentation.
[0366] The node attributes, or edge tokens, that are changed for data augmentation do not necessarily have to be just one; it is acceptable to change two or more edge tokens simultaneously. This is because natural language processing learns the relationships between edge tokens and their surroundings, and learning is possible even if several edge tokens around the target edge token are changed simultaneously, as long as the graph structure or active components do not change.
[0367] Furthermore, by augmenting the data by changing one or more edge tokens, the amount of text data handled by natural language processing during training can be reduced. This improves training efficiency. Moreover, in Figure 24, there are two edges, i.e., multiple edges, between node token X: LTM805a and node token D: 1N914. In this case, if two edges are obtained through natural language processing, the terminals to connect cannot be determined, and it is not possible to create a circuit from the graph data. Furthermore, regarding self-loops, information between the terminals of the short-circuited semiconductors is lost when converting the circuit to a graph, so it is not possible to generate a circuit simulation or a circuit that operates on actual hardware from the text data representing the graph data obtained from circuit generation.
[0368] Therefore, in Embodiment 5, a multi-terminal component such as the semiconductor X:LTM805a described in Embodiment 2 is divided into nodes according to the number of terminals. Figure 25 is a diagram showing an example (3) of the graph network in Embodiment 5, and shows a graph in which the semiconductor X:LTM805a is replaced with a star graph according to Embodiment 2. In this graph, a node token X:LTM805a, which will be a virtual node, is placed at the center of the terminal nodes that have been divided by terminal, and six terminal X 1-1 From X 1-6 It has a structure in which node tokens corresponding to it are connected. When applied to text created using terminal numbers, in a node center configuration it is replaced with the following text. V e:1 e:2 e:13 C:1u e:2 e:3 e:14 X:LTM805a e:17 e:18 e:19 e:20 e:21 e:22 X:LTM805a_1 e:1 e:3 e:17 X:LTM805a_2 e:4 e:18 X:LTM805a_3 e:4 e:19 X:LTM805a_4 e:5 e:20 e:11 C:1u e:7 e:10 e:12 e:15 R:10 e:8 e:11 e:12 e:16 GND e:9 e:13 e:14 e:15 e:16
[0369] However, in the circuit example, terminal numbers are assigned, so it is desirable to retain the terminal numbers as node tokens. But in multi-terminal nodes where the terminal numbers are unknown, it is also possible to represent them without assigning terminal numbers in the node center arrangement, as shown below. V e:1 e:2 e:13 C:1u e:2 e:3 e:14 X:LTM805a e:17 e:18 e:19 e:20 e:21 e:22 X:LTM805a e:1 e:3 e:17 X:LTM805a e:4 e:18 X:LTM805a e:4 e:19 X:LTM805a e:5 e:20 X:LTM805a e:6 e:7 e:8 e:21 e:7 e:10 e:12 e:15 R:10 e:8 e:11 e:12 e:16 GND e:9 e:13 e:14 e:15 e:16
[0370] Furthermore, the text representation with edge-centered placement is as follows: e:1 V X:LTM805a_1 e:2 V C:1u e:3 X:LTM805a_1 C:1u e:4 X:LTM805a_2 X:LTM805a_3 e:5 X:LTM805a_5 D:1N914 e:7 X:LTM805a_5 C:1u e:8 X:LTM805a_5 R:10 e:9 e: 11 C: 1u R: 10 e: 13 V GND e:14 C:1u GND e:15 C:1u GND e:16 R:10 GND e:17 X:LTM805a_1 X:LTM805a e:18 X:LTM805a_2 X:LTM805a e:19 X:LTM805a_3 X:LTM805a e:20 X:LTM805a_4 X:LTM805a e:21 X:LTM805a_5 X:LTM805a e:22 X:LTM805a_6 X:LTM805a
[0371] This representation also allows for the creation of unique text from the circuit. Furthermore, according to Embodiment 2, the representation may not include the node of interest. In Embodiment 5, which uses natural language processing, it is possible to predict that a single component exists from the node name contained in the node tokens of the text. That is, if node tokens from X:LTM805a_1 to X:LTM805a_6 are included, the component type "X" indicates that it is a semiconductor, the component model number LTM805a indicates that they are the same component, and the number after "_" indicates the terminal number.
[0372] The ability to represent data without using virtual nodes in this way leverages a feature unique to graph natural language processing, resulting in not only a reduction in the number of tokens and thus lower training costs, but also reduced generation costs. Furthermore, the small number of tokens generated and the absence of redundant representations (since the connection between virtual nodes and partition nodes in a star graph is obvious, they can be considered redundant) have the significant advantage of making it difficult to generate abnormal graph data.
[0373] Figure 26 shows an example (4) of a graph network in Embodiment 5. In the graph of Figure 26, the text for the node center arrangement is as follows: V e:1 e:2 e:13 C:1u e:2 e:3 e:14 X:LTM805a_1 e:1 e:3 X:LTM805a_2 e:4 X:LTM805a_3 e:4 X:LTM805a_4 e:5 e:7 e:8 e:15 e:16
[0374] Furthermore, the text with edge-centered placement will be as follows: e:1 V X:LTM805a_1 e:2 V C:1u e:3 X:LTM805a_1 C:1u e:4 X:LTM805a_2 X:LTM805a_3 e:5 X:LTM805a_5 D:1N914 e:7 X:LTM805a_5 C:1u e:8 X:LTM805a_5 R:10 e:9 e: 11 C: 1u R: 10 e: 13 V GND e:14 C:1u GND e:15 C:1u GND e:16 R:10 GND
[0375] In this way, since the terminal numbers are not degraded, it is possible to generate a graph that can be operated in circuit simulation from text data containing graph data generated by natural language processing, and to generate a netlist that can be operated in a circuit simulator or on actual hardware from the graph. However, if a single graph data contains two or more semiconductors (or multi-terminal components) of the same node type and with the same node attributes, the divided node names will be common. In that case, it is desirable to represent them with a node-centered arrangement.
[0376] Figure 27 is a diagram showing an example (5) of a graph network in Embodiment 5, which shows a single graph containing two identical semiconductors. By assigning a different edge token to each edge, the textual representation of the node center arrangement is as follows: V e:1 e:7 X:LTM805a_1 e:1 X:LTM805a_2 e:2 X:LTM805a_3 e:2 X:LTM805a_4 e:3 X:LTM805a_5 e:4 X:LTM805a_1 e:3 X:LTM805a_2 e:4 X:LTM805a_3 e:9 X:LTM805a_4 e:5 X:LTM805a_5 e:6 e:8 e:9 e:10
[0377] In this representation, two terminal nodes with the same name are connected to different edge tokens, indicating that they are two different components. This demonstrates a special effect: even if node tokens have the same name, if the connected wiring names are different, it is not necessary to assign a node ID to the terminal node.
[0378] However, if edge tokens represented by the same string are connected to the same terminal node, it becomes impossible to distinguish them as two different components. In such cases, it is desirable to assign features such as the node type or node attributes of both ends of the edge, or the node degree or the sum of the node degrees, as edge attributes that constitute the edge token.
[0379] In particular, if it is difficult to assign new features to edge tokens, or if they have exactly the same features, data augmentation can be performed to eliminate inequality by assigning edge IDs to the relevant identical edge tokens, or by assigning node IDs to the relevant node tokens. Since such data augmentation is small-scale, involving only a few node tokens or edge tokens, compared to augmenting the data of the entire graph, natural language processing is possible.
[0380] When generating a graph capable of constructing circuits using graph natural language processing, nodes with a node degree of "1" may be generated. In this case, since the circuit forms a closed loop, the circuit represented by the following text can be created by connecting the node with a node degree of "1" and the ground node with an edge. This circuit is likely to be a normal circuit, and this graph creation is a desirable process. However, it is desirable to remove nodes with a node degree of "1" that are only connected to the ground node. That is, the processing unit 14 may delete nodes that are only connected to the ground node, which represents ground. e:1 V LTM805a_1a e:2 LTM805a_2a LTM805a_3a e:3 LTM805a_1b LTM805a_4a e:4 LTM805a_2b LTM805a_5a e:5 LTM805a_4b R:10 e:6 LTM805a_5b LTM805a_6b e:7 V GND e:8 LTM805a_6a GND e:9 LTM805a_3b GND e:10 R:10 GND
[0381] Figure 28 shows an example (6) of a graph network in Embodiment 5, and shows a graph with nodes of node order 1. In Figure 28, when a graph is generated in which a 10μF capacitor C and a series circuit of a 10Ω resistor and a 1μF capacitor C are connected to a power supply V, there may be nodes with a node order of "1", such as the 1μF capacitor. In this case, it does not form a circuit, resulting in an abnormal circuit and a decrease in generation accuracy. Therefore, it is desirable to connect the node representing the 1μF capacitor C and the ground node with an edge.
[0382] Furthermore, in Embodiment 2, it was stated that the node with the highest node degree is selected as the centroid node. However, in the processing of Embodiment 4, the ground node tends to have the highest node degree, so the ground node can be made the centroid node. However, all circuits have a ground node and it does not represent a circuit characteristic. For this reason, if the ground node is the node with the highest node degree, it is desirable to make a node with the second or lower node degree the centroid node. That is, the node tokens of the nodes extracted from the graph data, excluding the ground node representing the ground, are used as the node tokens of the centroid node. This reduces the learning cost.
[0383] As described above, in the graph natural language processing device 1 according to Embodiment 5, the graph data acquisition unit 11 acquires graph data in which the type of circuit component is used as the node type and the circuit constant or the circuit model number is used as the node attribute. This makes it possible to represent various circuits in a graph network using node types and node attributes.
[0384] In the graph natural language processing device 1 according to Embodiment 5, circuit components and ground are defined as nodes, and wiring excluding ground is defined as an edge. This reduces the number of multiple edges by adding a ground node, and allows the information of the ground node to be retained in the graph network. Therefore, it is possible to generate a string that includes ground.
[0385] In the graph natural language processing device 1 according to Embodiment 5, the processing unit 14 outputs text consisting of node tokens, excluding the ground node representing the ground. This reduces the number of multiple edges for ground wiring and thus the number of tokens to be processed, thereby reducing computational cost.
[0386] The graph natural language processing device 1 according to Embodiment 5 connects nodes with a node order of 1 and ground nodes representing the ground with edges. This improves the efficiency of circuit generation.
[0387] The graph natural language processing device 1 according to Embodiment 5 deletes nodes that are connected only to ground nodes representing the ground. This improves the efficiency of circuit generation.
[0388] In the graph natural language processing device 1 according to Embodiment 5, the processing unit 14 augments data by forming an equivalent circuit including parasitic components of circuit parts into a graph network. As a result, since the parasitic components are used to represent high frequencies, a graph representation that takes high frequencies into account can be made, making it easier to extract feature quantities from the graph data. Furthermore, since this involves adding nodes or changing node attributes based on physical quantities, there is an effect that abnormal circuit data is not generated by data augmentation.
[0389] In the graph natural language processing device 1 according to Embodiment 5, the processing unit 14 augments data by forming an equivalent circuit including the spaces between circuit components, between circuit components and wiring, between wirings, parasitic capacitance, or residual inductance into a graph network. As a result, since the parasitic components are used to represent high frequencies, a graph representation that takes high frequencies into account can be achieved, making it easier to extract feature quantities from the graph data. Furthermore, because the addition of nodes or modification of node attributes is based on physical quantities, there is an effect that abnormal circuit data is not generated by the data augmentation.
[0390] In the graph natural language processing device 1 according to Embodiment 5, the node tokens of the nodes extracted from the graph data, excluding the ground node representing the ground, are the node tokens of the centroid node. This reduces the learning cost.
[0391] Embodiment 6. The graph natural language processing device according to Embodiment 6 outputs text data created by the graph natural language processing devices according to Embodiments 1 to 5 to a natural language processing device represented by a transformer. The natural language processing device outputs feature quantities of the text data input from the graph natural language processing device, or text data having graph data that includes the input text data, or text data having graph data different from the input text data. Furthermore, the text data input to the natural language processing device does not need to be text data that includes graph data; it may be text data composed of natural language that describes the features of the graph data to be generated. Note that the graph natural language processing device according to Embodiment 6 has the same components as the graph natural language processing device 1 shown in Figure 1, but the functions of each component differ as will be described later. The configuration of the graph natural language processing device according to Embodiment 6 will be described below with reference to Figure 1.
[0392] (Natural Language Processing Unit) The natural language processing unit is a device not shown in Figure 1. When text data output from the graph natural language processing unit 1 according to Embodiments 1 to 6 is input, the unit analyzes the text by performing time-series processing with the order of the input text as the time direction. That is, the processing unit 14 of the graph natural language processing unit 1 according to Embodiment 6 obtains the time-series processing result of the text using the natural language processing unit. Deep learning is known for time-series processing. The following will explain time-series processing based on deep learning.
[0393] For time series processing, convolutional neural networks (CNNs) in deep learning may be used. Alternatively, recurrent neural networks (RNNs) may be used. Recurrent neural networks will be explained below.
[0394] Various methods are known for recurrent neural networks. LSTM (Long Short Term Memory) is one method that reduces the time-series forgetting inherent in RNNs. Seq2Seq (Sequence to Sequence) consists of an encoder model that extracts features from time-series data input from LSTM, and a decoder model that creates time-series data from the features extracted by the encoder model. Seq2Seq is highly versatile and can be used, for example, in machine translation because it creates time-series data different from the input time-series data.
[0395] However, RNNs, as well as LSTM or Seq2Seq, cannot begin predicting the next value until the previous value is determined, even when using hardware that excels at parallel processing (such as GPUs, TPUs, ASICs, and FPGAs). Therefore, hardware utilization efficiency is low, averaging around 30%. Consequently, large-scale training and inference require a long time.
[0396] The transformer model performs the above-described process using hardware parallel processing. The transformer model enables parallelization by incorporating attentions that correlate tokens between the encoder and decoder models of Seq2Seq. Furthermore, in addition to sequence models (also called encoder-decoder models) that combine encoder and decoder models, similar to Seq2Seq, transformer models are known to include encoder models that extract features from input text and decoder models that generate text from features.
[0397] Embodiment 6 describes a method based on a transformer model. The results of processing the graphs of text created in each process from Embodiment 1 to Embodiment 3 using the circuit shown in Embodiment 4 are described. As an example, the sequence model is a neural network model called T5 (Text-to-Text Transformer Transformer). The encoder model is a neural network model called Bert (Bidirectional Encoder Representations from Transformers). The decoder model is a neural network model called GPT (Generative Pre-trained Transformer). In addition to transformer models, selective state-space models are known to suppress the amount of Attention memory, and these include neural network models such as Mamba or Samba.
[0398] However, there are hundreds of models derived from these. Hundreds of similar technologies have also been published. Any model that can combine these technologies to perform natural language processing and can handle text in at least one of its inputs and outputs is acceptable. For example, the processing unit 14 may take text as input to the model and output the features of the graph network. This allows for the extraction of the graph network's features using natural language processing.
[0399] Furthermore, transformer models or selective state-space models are currently used for evaluation simply because they offer high inference accuracy; any method that offers high inference accuracy does not necessarily have to be based on neural networks.
[0400] In natural language processing, a tokenizer divides text into words, and these words are replaced with unique numerical values. The processing unit 14 can divide text into node tokens or edge tokens by creating divided text using delimiters. This makes it easy to divide text into words.
[0401] Furthermore, the graph natural language processing device 1 according to Embodiment 6 may also include a whitespace tokenizer. The whitespace tokenizer divides the string of text data using a half-width space " " as a delimiter. If a custom-defined delimiter is used, a tokenizer that divides the string into words according to that delimiter may be used.
[0402] Various tokenizers are known, including BPE (Byte-Pair Encoding), Sentencepiece, Wordpiece, and Unigram. When using a half-width space as a delimiter, it is desirable to use a tokenizer that splits using a delimiter that includes a whitespace tokenizer.
[0403] The graph natural language processing device 1 according to Embodiment 6 may include a Sentence Piece Tokenizer. The Sentence Piece Tokenizer divides the string of text data by making the number of tokens the same as the number of edge tokens. The Sentence Piece Tokenizer divides the text into words and determines the frequency of each word. High-frequency words are treated as one token, and low-frequency words are divided into shorter words and treated as one token each. This reduces the number of tokens. Since there are fewer edge tokens related to the graph compared to natural language in order to train similar circuits, even low-frequency edge tokens tend to become one token. For this reason, the same division as the whitespace tokenizer is possible.
[0404] For example, the text data converted from the graph shown in Figure 3 is set to "A:1000 f:1 f:1 B:1 e:1 B:10 e:1 e:10 f:1 C:100 e:10 f:1". The processing unit 14 sets the string "A:1000" to "1", "B:1" to "2", "B:10" to "3", "C:100" to "4", "e:1" to "5", "e:10" to "6", and "f:1" to "7". As a result, the text data is converted to "1 7 7 2 5 3 5 6 7 4 6 7". This converted data is then input to the natural language processing unit.
[0405] Similarly, in edge-center representation, the string of text data converted from the graph shown in Figure 3 is "e:1 B:1 B:10 e:10 B:10 C:100 f:1 B:10 A:1000 f:1 A:1000 C:100". As a result, the processing unit 14 creates the following text data: "5 2 3 6 3 4 7 3 1 7 1 4".
[0406] However, the transformer model has the problem of losing token position information due to parallel processing. Therefore, similar to Attention, it may be possible to learn the position of each token within the text using positional encoding.
[0407] Next, we will explain how to utilize sequence models, encoder models, and decoder models, respectively. Note that sequence models are also called encoder-decoder models. Sequence models can rewrite input text into other text based on learning results, for example, as used in machine translation. This feature allows us to input the text of an entire graph into a sequence model and output an optimized version of the entire graph. For example, in the case of a circuit, if the circuit is input into the sequence model as text data based on embodiments 1 to 4, it is possible to output circuits with different circuit topologies, part numbers of circuit components used, or circuit constants.
[0408] The graph natural language processing unit 1 may take only the node tokens from the text as input and output text containing the node tokens and edge tokens. This allows for the generation of a graph with specified nodes and the design of a graph based on a dataset. Alternatively, the processing unit 14 may use an encoder model to take text in which some node tokens or edge tokens have been replaced with hidden characters as input and output the hidden characters. The encoder model can, for example, perform sentiment analysis of the input natural language, or, if part of the text is hidden as input, predict the tokens of the hidden text.
[0409] Furthermore, it can be used as a regression problem. For example, when text data representing a circuit is input to the encoder model, the encoder model can predict the required board area for implementation, estimate the cost, or predict the physical quantities of heat or noise generated. In addition, by inputting hidden edge tokens and predicting the hidden values, edges can be predicted.
[0410] Furthermore, the processing unit 14 may, for example, use a decoder model to input a portion of text and predict the remaining text, or input the entire text and create a summary of the input text. That is, the graph natural language processing device 1 according to Embodiment 6 may input a portion of text and output the entire text. Alternatively, it may input text and output text different from the input text. For example, the processing unit 14 may use a decoder model to input text data representing a portion of a circuit and create text data representing the remaining circuit necessary to complete the circuit. Alternatively, the decoder model may input text data representing the entire circuit and convert the text data representing the function or characteristics of the circuit into a form that can be understood by humans as natural language. Furthermore, the graph natural language processing device 1 may input text representing a circuit and output text representing a circuit optimized for a desired operation. In this way, by combining training data and natural language, it is possible to utilize this for graph generation or optimization, graph understanding, and node or edge prediction.
[0411] Next, we will explain how to evaluate graphs generated by sequence models, encoder models, or decoder models. Generally, natural language processing uses cross-entropy as an evaluation function to learn the next token so that the difference between the predicted value and the correct answer in the training data becomes small. However, in text generation by the graph natural language processing device 1, even if the cross-entropy is small, it does not necessarily mean that the text contains correct graph information.
[0412] Therefore, the processing unit 14 creates abnormal value training data by modifying the graph data from normal training data by changing node types, node attributes, adding or deleting nodes, or adding or deleting edges. Then, the processing unit 14 receives the training data, which is graph data, and the abnormal data, which is the training data with the node types swapped, and determines that the training data is normal and the abnormal data is abnormal. For example, the processing unit 14 evaluates the graph using a learning device trained in binary classification (also called Anomaly Detection), which determines that the training data is normal and the abnormal value training data is abnormal, or multi-class classification. In multi-class classification, for example, values are set as follows: normal is "0", abnormal node type is "1", abnormal node attribute is "2", abnormal due to node addition or deletion is "3", and abnormal due to edge addition or deletion is "4". Experiments have confirmed that by selecting two nodes from a graph created from an actual circuit and swapping their node types only once, and using this data as anomalous data, a normal circuit can be generated with approximately 99% accuracy during training with a graph neural network. Similar accuracy can also be obtained with graph natural language processing training. However, swapping nodes representing parallel connected components does not change the circuit characteristics or graph structure, so it does not become anomalous data. In other words, if anomalous data is isomorphic, and this isomorphic data is split into training data and test data, the training data will contain exactly the same data as the test data, leading to overfitting. Isomorphism refers to graph isomorphism. In graph isomorphism, everything, including node attributes and edge attributes, matches between graphs. Therefore, the processing unit 14 creates two or more anomalous data from one training data and removes anomalous data that is isomorphic to the training data or anomalous data that is isomorphic to each other. Note that determining graph isomorphism requires a large amount of computation, and if graph isomorphic, the graph structure does not change even if the node types are swapped. For this reason, the determination of whether or not graph isomorphic is made based on the comparison result of the node types of adjacent nodes. By performing this process, the accuracy of anomaly detection can be improved.Graph isomorphisms can be obtained using the Weisfeiler-Lehman algorithm.
[0413] In natural language processing inference, text output from the natural language processing device is input to the learning device. If it is determined to be normal, the generation is considered successful; if it is determined to be abnormal, the generation is considered unsuccessful. Abnormal training data is created by modifying the graph data from normal training data by changing node types, node attributes, adding or deleting nodes, or adding or deleting edges. The learning device may be the graph natural language processing device 1 according to Embodiments 1 to 5. The learning device may also be one that learns graph classification problems using a graph neural network.
[0414] The anomaly detection model tends to have high inference accuracy, and when the circuit described later is used as the dataset, it achieves an inference accuracy of 99.58% in binary classification using a graph neural network, and can be used to evaluate the generated graph. However, as shown in Embodiment 4, the anomaly detection model may be trained on training data that includes the range of possible circuit components by increasing the number of node types of node tokens using domain knowledge. This allows for the determination of anomaly data using node attributes.
[0415] Next, the experimental results are presented. The experiment involved using the circuit described in Embodiment 4, with one experiment each conducted on an encoder model and a decoder model. For the encoder model, a method based on a graph neural network was performed for comparison. For the decoder model, a method based on a graph neural network and a method in which the netlist created from the circuit was directly input to the natural language processing unit were performed for comparison.
[0416] The encoder model presented a classification problem involving 3,308 circuits, categorized into seven types: A / D converter circuits, comparator circuits, filter circuits, operational amplifier circuits, power supply circuits, reference circuits, and switch circuits. The average number of nodes for A / D converter circuits was 12.75, and the average number of edges was 23.75. The average number of nodes for comparator circuits was 8.60, and the average number of edges was 19.56. The average number of nodes for filter circuits was 13.60, and the average number of edges was 32.92. The average number of nodes for operational amplifier circuits was 9.98, and the average number of edges was 21.22. The average number of nodes for power supply circuits was 14.00, and the average number of edges was 37.78. The average number of nodes for reference circuits was 6.17, and the average number of edges was 30.89. The switch circuit has an average of 8.88 nodes and an average of 15.65 edges.
[0417] The netlist will be in the format that LTspice outputs by default. For example, the netlist for the semiconductor LT1026 used in a power supply circuit is expressed as follows: XU1 N001 N003 N004 OUT- 0 IN N002 OUT+ LT1026 C1 N002 N001 1u C2 N003 N004 1u C3 0 OUT- 1u C4 OUT+ 0 1u V1 IN 0 4
[0418] The processing unit 14 inputs the above netlist to Bert, which is a natural language processing encoder model, and performs scratch learning without using a pre-trained model. In scratch learning, learning starts with a uniform weight matrix of random numbers. Here, the natural language processing encoder model is the natural language processing unit. The reason for performing scratch learning is that when performing transfer learning or fine tuning of a pre-trained model, it is difficult to change the tokenizer, add or delete tokens. In other words, edge tokens cannot be assigned to a single token, and the edge tokens are divided into partitioned tokens.
[0419] For example, “X:LTM805a-C:1u” is broken down into separate elements: “X”, “LT”, “M”, “805”, “a-”, “C:”, and “1u”. When broken down into separate elements in this way, they are output as separate elements during generation, so the output text is not necessarily a graph, which is undesirable as it contradicts the objective of Embodiment 6, which is to improve graph generation efficiency. However, conventional natural language processing cannot assign new tokens to a trained model. Therefore, in order to freely determine tokens, it is desirable to perform scratch learning, starting the learning of the weight matrix from normalized random numbers such as random numbers, He initialization, and Xavier initialization, without performing fine tuning or transfer learning using a trained model. For evaluation, 70% of the 3,308 data points were used for training and the remaining 30% for testing, and the inference accuracy was confirmed.
[0420] Furthermore, to reduce the impact of variability between training data and test data, ten combinations were created for both training data and inference data, and the average inference accuracy was taken. The data allocated to training data and inference data was also made common. As a result, when the graph natural language processing device 1 according to Embodiment 6 was used as a graph classifier and a netlist derived from LTspice was directly input, the inference accuracy was 96.72%. In contrast, when the graph was converted into a string and training and inference were performed using any of the methods according to Embodiments 1 to 3, the inference accuracy improved to 97.11%. In this case, the processing unit 14 did not perform the data augmentation shown in Embodiment 3.
[0421] Furthermore, even when the netlist was entered directly, no data augmentation was performed to compensate for inequalities in node IDs or edge IDs. However, since circuits from the same manufacturer were used, the assignment of node IDs or edge IDs was common, which is likely why the inference accuracy improved.
[0422] When using a node center, adjacent edge tokens have no characteristics in the circuit. Therefore, the node type was defined as a string combining the node tokens of the nodes connected to both ends of the edge, and no node attributes were assigned. In this way, as many edge tokens as there are combinations of node tokens appear, the inference accuracy is considered to be equivalent to when the netlist is directly input. Alternatively, the results of circuit simulation may be used for edge attributes.
[0423] In Embodiment 5, the explanation focused on graph generation, but the encoder model also yielded results equivalent to or better than those obtained using node IDs. Therefore, in Embodiment 6, it can be confirmed that no information degradation occurs by replacing node IDs with node tokens and edge tokens.
[0424] As a result, in Embodiment 6, the data augmentation shown in Embodiment 4 was not performed on any of the datasets. However, performing the data augmentation shown in Embodiment 4 further improves the inference accuracy of graph classification. As an experiment with the decoder model, a power supply circuit with 2,477 circuits from the LTspice dataset was used as training data. GPT-2 was used as the decoder model, and the text was split using a whitespace tokenizer during scratch training.
[0425] Using the trained GPT-2 model, the first 10 tokens of the text generated from each of the 2,477 power supply circuits were input into the trained model, and the remaining circuits were predicted. As mentioned above, the average number of edge tokens in a power supply circuit is 37.78, the same as the number of edges; therefore, 10 edge tokens represent approximately one-quarter of the entire circuit. When the predicted circuits were converted into graphs, all 2,477 texts could be converted into graphs.
[0426] The graph converted from text may contain nodes with a node degree of "1". Circuit components with a node degree of "1" cannot form a closed loop, which is essential for circuit construction, and therefore do not constitute a circuit. To make it easier to satisfy the conditions for becoming a circuit, the processing unit 14 connects nodes with a node degree of "1" to ground nodes with edges. However, if an adjacent node connected with a node degree of "1" is a ground node, the processing unit 14 deletes the node with a node degree of "1".
[0427] The graph generated in this way was then analyzed for normality using a graph neural network model trained to determine normality or abnormality based solely on node type. The inference accuracy of the graph neural network model trained to determine normality and abnormality was 99.58%. Using this trained model, 1,291 out of the 2,477 power supply circuits generated were identified as normal, representing 52.12%.
[0428] On the other hand, for comparison with conventional methods, we trained and generated 2,477 power supply circuits using the graph neural network-based method with the highest generation accuracy. The generation accuracy was 0.1% with GraphRNN, which had the highest generation efficiency.
[0429] In Graph RNNs, nodes and edges are generated sequentially, including their type and attributes, which causes the computational complexity during training or generation to increase exponentially. Therefore, typical computers are limited to training and generating around 20 nodes. When training with a dataset limited to 20 nodes or less, 10 million graph data points were generated, and only 120 were judged as normal. Furthermore, it was confirmed that the circuits judged as normal were not the intended circuits.
[0430] In addition to Graph RNN, we also applied the latest technologies such as Graph AutoEncoder, Graph Diffusion, Graph Reinforcement Learning, and Graph GAN. However, the accuracy of Graph RNN is not sufficient to surpass the accuracy of graph generation using graph data as shown in Embodiment 6.
[0431] Furthermore, when the netlist of the LTspice power supply circuit was directly input into the GPT-2 and the same processing as above was performed, 675 nodes, or 27%, met the constraints of the graph data when converting the generated text to a graph. In addition, the processing unit 14 connected the 675 nodes with a node order of "1" to the ground node with an edge or deleted them. When this was input into a model that determines normal and abnormal based on a graph neural network, 10.96% of the 675 were determined to be normal circuits. This corresponds to 2.99% of the 2,477 circuits. The main reason why it was not possible to convert from text to graph is that, for example, components that need to have circuit constants or part numbers do not have that information.
[0432] From the above results, compared to the case where the netlist is directly input to the natural language processing unit and the circuit is generated using the natural language processing decoder model, the method according to Embodiment 6 improves the efficiency of generating a normal circuit by more than 17 times (from 2.99% to 52.12%). For this reason, the graph natural language processing method according to Embodiment 6 provides special advantages compared to conventional methods.
[0433] Furthermore, in Graph RNNs, which are based on graph neural networks and have high generation accuracy, nodes and edges are generated sequentially, including their type and attributes, so the computational complexity during training or generation increases exponentially. For this reason, training and generation are limited to around 20 nodes on a typical computer. When the dataset is limited to 20 nodes or less and training is performed, 10 million circuits are generated, and only 120 circuits are judged to be normal. Moreover, it has been confirmed that the circuits judged to be normal are not the expected circuits with the expected circuit components and characteristics.
[0434] Furthermore, conventional graph neural network-based methods not only cannot create circuits containing specific circuit elements, but also have a low probability of the generated circuits being judged as normal circuits, making them unsuitable for generating data with strong physical constraints, such as circuits. In contrast, the graph natural language processing method shown in Embodiment 6 has no limit on the number of nodes that can be handled, and can be trained and inferred on a general-purpose low-spec computer. Moreover, it can generate graph data containing specific elements with high generation accuracy. In particular, many conventional methods such as Graph AutoEncoder or Graph Diffusion use the graph as a feature space and add noise to the feature space, so graphs containing specific elements can only be generated with a very low probability. In contrast, the graph natural language processing device 1 can include specific elements in the text input to the trained model, so it can generate circuits containing specific elements with 100% efficiency.
[0435] Furthermore, these graph generation methods using anomaly detection are not limited to circuits; they can be used for any type of graph data. In particular, the graph data is treated as a normal graph, and the data with the modified graph data is treated as anomaly data. An evaluation function is then created using a graph neural network. This allows the generated graph to be evaluated for any type of graph data without using domain knowledge.
[0436] For example, it can be easily applied to inorganic compounds, proteins, genes, physical simulation models, etc. other than circuits. The physical simulation model divides space into tetrahedrons or hexahedrons, etc. Not only prediction from conventional graph data but also generation of an object based on graph data can be realized according to Embodiment 6. For example, when the graph network relates to an inorganic compound, the processing unit 14 may add a hydrogen atom as a node to a node whose valence is less than the number of edges and connect them so as to satisfy the valence. Further, when the graph network relates to mesh data of the finite element method, the processing unit 14 may increase the node degree to 3 or more by adding an edge between adjacent nodes to a node whose node degree is "2" or less. Thus, Embodiment 6 can also be applied to graphs other than circuits.
[0437] As described above, in the graph natural language processing apparatus 1 according to Embodiment 6, the processing unit 14 divides text into node tokens or edge tokens using delimiter characters. Thereby, a character string composed of node tokens and edge tokens can be separated into node tokens and edge tokens one by one.
[0438] The graph natural language processing apparatus 1 according to Embodiment 6 inputs a part of text and outputs the whole text. Thereby, a graph having a specified node can be generated. Further, a graph can be designed based on a data set.
[0439] The graph natural language processing apparatus 1 according to Embodiment 6 inputs text and outputs text different from the input text. Thereby, the graph network can be optimized.
[0440] The graph natural language processing apparatus 1 according to Embodiment 6 inputs only node tokens in text and outputs text including node tokens and edge tokens. Thereby, a graph having a specified node can be generated. Further, a graph can be designed based on a data set.
[0441] The graph natural language processing apparatus 1 according to Embodiment 6 inputs text in which part of a node token or an edge token is replaced with a hidden character, and outputs the hidden character. Thereby, since the character string constituting the graph network can be optimized, the node token or the edge token can be predicted.
[0442] The graph natural language processing apparatus 1 according to Embodiment 6 inputs text and outputs a feature amount of a graph network. Thereby, the feature amount of the graph network can be extracted in natural language processing.
[0443] In the graph natural language processing apparatus 1 according to Embodiment 6, the processing unit 14 inputs learning data that is graph data and abnormal data in which the node types of the learning data are interchanged, determines that the learning data is normal, and determines that the abnormal data is abnormal. Thereby, the generation efficiency can be evaluated, and a graph network that does not require evaluation can be separated.
[0444] In the graph natural language processing apparatus 1 according to Embodiment 6, the processing unit 14 creates two or more pieces of abnormal data from one piece of learning data, and removes abnormal data that is graph-isomorphic to the abnormal data and the learning data or abnormal data that is isomorphic between the abnormal data. Thereby, the accuracy of the abnormality determination can be improved.
[0445] In the graph natural language processing apparatus 1 according to Embodiment 6, the graph network indicated by the graph data relates to an inorganic compound, and the processing unit 14 adds a hydrogen atom as a node to a node whose valence is less than the number of edges, and connects them so as to satisfy the valence. Thereby, it can be applied to graphs other than circuits.
[0446] In the graph natural language processing apparatus 1 according to Embodiment 6, the graph network indicated by the graph data relates to finite element method mesh data, and the processing unit 14 adds an edge between adjacent nodes to nodes with a node degree of 2 or less, and sets the node degree to 3 or more. Thereby, it can be applied to graphs other than circuits.
[0447] The graph natural language processing device 1 according to Embodiment 6 includes a whitespace tokenizer for splitting text. This makes it possible to separate a string composed of node tokens and edge tokens into node tokens and edge tokens.
[0448] The graph natural language processing device 1 according to Embodiment 6 includes a sentence piece tokenizer for splitting text. This makes it possible to separate a string composed of node tokens and edge tokens into node tokens and edge tokens.
[0449] In the graph natural language processing device 1 according to Embodiment 6, the processing unit 14 learns text using scratch learning in the natural language processing device. This makes it possible to accurately divide node tokens or edge tokens, which are tokens not included in general natural language processing.
[0450] The graph natural language processing device described herein can be used, for example, in various technical fields that deal with graph representations.
[0451] Furthermore, this disclosure allows for free combination of each embodiment, modification of any component of each embodiment, or omission of any component in each embodiment.
[0452] 1 Graph natural language processing unit, 11 Graph data acquisition unit, 12 Node extraction unit, 13 Edge extraction unit, 14 Processing unit, 100 Input interface, 101 Output interface, 102 Processing circuit, 103 Processor, 104 Memory.
Claims
1. A graph natural language processing device comprising: a graph data acquisition unit for acquiring graph data; a node extraction unit for extracting nodes including node type and node attributes from the graph data; an edge extraction unit for extracting edges including edge type and edge attributes from the graph data; and a processing unit for outputting a node token formed by combining the node type and node attributes extracted by the node extraction unit, an edge token formed by combining the edge type and edge attributes extracted by the edge extraction unit, and text arranged with the node token and the edge token.
2. The graph natural language processing device according to claim 1, characterized in that the text is a text obtained by arranging the node tokens and the edge tokens of the edges connected to the nodes of the node tokens, separated by a delimiter.
3. The graph natural language processing device according to claim 1, characterized in that the text is a text obtained by arranging the edge tokens and the node tokens of the nodes to which the edges of the edge tokens are connected, separated by a delimiter.
4. The graph natural language processing device according to any one of claims 1 to 3, characterized in that one of the elements constituting the edge attribute has an edge orientation.
5. The graph natural language processing device according to any one of claims 1 to 3, characterized in that one of the elements constituting the edge attribute has the code of an edge.
6. A graph natural language processing device according to any one of claims 1 to 3, characterized in that a string that is not included in the string constituting the node type or node attribute and is not generated by the combination of the node type and node attribute is used as a first delimiter, and the node type and node attribute are combined using the first delimiter.
7. The graph natural language processing device according to claim 6, characterized in that the first delimiter is a string that does not result from a combination of node type, node attribute, edge type, and edge attribute.
8. A graph natural language processing device according to any one of claims 1 to 3, characterized in that a second delimiter is a string that is not included in the string constituting the edge type or edge attribute and is not generated by the combination of the edge type and edge attribute, and the edge type and edge attribute are combined using the second delimiter.
9. The graph natural language processing device according to claim 8, characterized in that the second delimiter is a string that does not result from a combination of node type, node attribute, edge type, and edge attribute.
10. The graph natural language processing device according to claim 2 or 3, characterized in that the processing unit replaces half-width spaces contained in the node token with a first replacement character containing an empty string, replaces half-width spaces contained in the edge token with a second replacement character containing an empty string, and sets the delimiter to a half-width space.
11. The graph natural language processing device according to any one of claims 1 to 3, characterized in that the processing unit creates the same number of terminal nodes as the number of terminals of a multi-terminal node having three or more terminals, changes the ends of the edges connected to the multi-terminal node to connections from the multi-terminal node to terminal nodes, and deletes the multi-terminal node.
12. The graph natural language processing device according to any one of claims 1 to 3, characterized in that the processing unit creates the same number of terminal nodes as the number of edges connected to a multi-terminal node that is connected to three or more edges, connects the ends of the edges connected to the multi-terminal node to terminal nodes, and deletes the multi-terminal node.
13. The graph natural language processing device according to any one of claims 1 to 3, characterized in that the processing unit creates a multi-terminal node having two or more edges between itself and an adjacent node, and the same number of terminal nodes as the number of edges that form multiple edges, and changes the ends of the multiple edges connected to the multi-terminal node to connections to terminal nodes.
14. The graph natural language processing device according to any one of claims 1 to 3, characterized in that the processing unit creates a multi-terminal node having a self-loop and twice the number of terminal nodes as the number of self-loops, and changes the connections of both ends of the self-loops connected to the multi-terminal node to connections to the terminal nodes.
15. The graph natural language processing device according to claim 11 or 12, characterized in that the processing unit provides one virtual node for one multi-terminal node and connects the terminal nodes via the virtual node.
16. The graph natural language processing device according to claim 13 or 14, characterized in that the processing unit provides one virtual node for one multi-terminal node and connects the multi-terminal node and the terminal nodes via the virtual node.
17. The graph natural language processing device according to any one of claims 12 to 16, characterized in that, among the terminal nodes of the node tokens represented by two or more identical strings, the strings representing the edge tokens connected to the target terminal node are different.
18. The graph natural language processing device according to any one of claims 12 to 16, characterized in that the processing unit assigns a node ID to a target terminal node among the terminal nodes of the node token represented by two or more identical strings.
19. The graph natural language processing device according to any one of claims 1 to 3, characterized in that the processing unit divides a directional node into two nodes and assigns a different node type to each of the divided nodes.
20. The graph natural language processing device according to claim 19, characterized in that the processing unit connects the two divided nodes in parallel.
21. The graph natural language processing device according to claim 19, characterized in that the processing unit connects the two divided nodes in series and assigns a different node token to each node.
22. The graph natural language processing device according to claim 20, characterized in that the processing unit connects the two parallel-connected nodes with an edge.
23. The graph natural language processing device according to claim 22, characterized in that the edges between the two divided nodes are unidirectional directed edges.
24. The graph natural language processing device according to claim 1, characterized in that the node token combines the node type and node attributes in the same order for all nodes in the graph data.
25. The graph natural language processing device according to claim 1, characterized in that the edge token combines the edge type and edge attributes in the same order for all edges in the graph data.
26. The graph natural language processing device according to claim 2, characterized in that the edge tokens for each node token are arranged in order of the sum of the node degrees at both ends of the edge.
27. The graph natural language processing device according to claim 3, characterized in that the edge tokens in the text are arranged in order of the sum of the node degrees of both ends of the edge.
28. The graph natural language processing device according to claim 2, characterized in that the edge tokens for each node token are arranged in order of the maximum node degree at both ends of the edge.
29. The graph natural language processing device according to claim 3, characterized in that the edge tokens in the text are arranged in order of the maximum node degree at both ends of the edge.
30. The graph natural language processing device according to claim 2, characterized in that the edge tokens for each node token are arranged in order of the distance from the centroid node, which is one node in the graph data, to each edge.
31. The graph natural language processing device according to claim 3, characterized in that the edge tokens in the text are arranged in order of the distance from the centroid node, which is one node in the graph data, to each edge.
32. The graph natural language processing device according to claim 2, characterized in that the edge tokens are arranged in order of terminal number with respect to the node token having a terminal number.
33. The graph natural language processing device according to claim 3, characterized in that the edge tokens in the text are arranged in order of terminal number with respect to the node tokens having terminal numbers.
34. The graph natural language processing device according to any one of claims 26 to 33, characterized in that the edge tokens whose sum of node degrees is equal, whose maximum node degree is equal, whose distance from the centroid node is equal, or whose terminal number is equal are arranged in lexicographical order.
35. The graph natural language processing device according to any one of claims 26 to 33, characterized in that the processing unit augments data by rearranging the order of edge tokens such that the sum of node degrees is equal, the maximum node degree is equal, the distance from the centroid node is equal, or the terminal number is equal.
36. The graph natural language processing device according to claim 2, characterized in that the node tokens in the text are arranged in order of node degree.
37. The graph natural language processing device according to claim 3, characterized in that the node tokens for each edge token are arranged in order of node degree.
38. The graph natural language processing device according to claim 2, characterized in that the node tokens in the text are arranged in order of distance from the centroid node, which is one node in the graph data.
39. The graph natural language processing device according to claim 3, characterized in that the node tokens for each edge token are arranged in order of distance from the centroid node, which is one node in the graph data.
40. The graph natural language processing device according to any one of claims 36 to 39, characterized in that node tokens having the same node degree or the same distance from the centroid node are arranged in lexicographical order.
41. The graph natural language processing device according to any one of claims 36 to 39, characterized in that the processing unit augments data by rearranging the order of the node tokens whose sum of node degrees is equal or whose distance from the centroid node is equal.
42. The graph natural language processing device according to any one of claims 30, 31, 38, and 39, characterized in that the centroid node is the node with the highest node degree.
43. The graph natural language processing device according to any one of claims 1 to 3, characterized in that the processing unit augments data with the node tokens whose node attributes have been modified.
44. The graph natural language processing device according to any one of claims 1 to 3, characterized in that the processing unit replaces node attributes for nodes of the same node type but with different node attributes, or augments data with node tokens obtained by duplicating specific node attributes.
45. The graph natural language processing device according to any one of claims 1 to 3, characterized in that the processing unit replaces node attributes for nodes of the same node type, the same node order, and different node attributes, or augments data with node tokens obtained by duplicating specific node attributes.
46. The graph natural language processing device according to any one of claims 1 to 3, characterized in that the processing unit augments data with the edge tokens whose edge attributes have been modified.
47. The graph natural language processing device according to any one of claims 1 to 3, characterized in that the processing unit replaces edge attributes for edges of the same edge type but with different edge attributes, or augments data with edge tokens obtained by duplicating specific edge attributes.
48. The graph natural language processing device according to any one of claims 1 to 3, characterized in that the processing unit replaces edge attributes for edges that have the same edge type, the same node attributes for the nodes connected to both ends of the edge, and different edge attributes, or augments data with edge tokens obtained by duplicating specific edge attributes.
49. The graph natural language processing device according to claim 35, 41 and any one of claims 43 to 48, characterized in that the processing unit modifies two or more node tokens or edge tokens to create a data-augmented string.
50. The graph natural language processing device according to any one of claims 1 to 3, characterized in that the graph data acquisition unit acquires graph data in which the type of circuit component is the node type and the circuit constant or the circuit model number is the node attribute.
51. The graph natural language processing device according to claim 50, characterized in that circuit components and ground are defined as nodes, and wiring excluding ground is defined as an edge.
52. The graph natural language processing device according to claim 51, characterized in that the processing unit outputs the text which is an arrangement of the node tokens, excluding the ground node which represents the ground.
53. The graph natural language processing device according to claim 51, characterized in that a node with a node order of 1 and a ground node representing the ground are connected by an edge.
54. The graph natural language processing device according to claim 50 or 51, characterized in that it removes nodes connected only to ground nodes that represent ground.
55. The graph natural language processing device according to claim 50 or 51, characterized in that the processing unit augments data by forming an equivalent circuit including parasitic components of circuit parts into a graph network.
56. The graph natural language processing device according to claim 50 or 51, characterized in that the processing unit augments data by forming an equivalent circuit including the spaces between circuit components, between circuit components and wiring, between wirings, parasitic capacitance, or residual inductance into a graph network.
57. The graph natural language processing device according to claim 51, characterized in that the node tokens of the nodes extracted from the graph data, excluding the ground node representing the ground, are the node tokens of the centroid node.
58. The graph natural language processing device according to any one of claims 6 to 8, characterized in that the processing unit divides the text into node tokens or edge tokens using a delimiter.
59. The graph natural language processing device according to 58, characterized in that it takes a portion of the aforementioned text as input and outputs the entire aforementioned text.
60. The graph natural language processing device according to 58, characterized in that it takes the aforementioned text as input and outputs text different from the input text.
61. The graph natural language processing device according to claim 58, characterized in that it takes only the node tokens from the text as input and outputs text that includes the node tokens and the edge tokens.
62. The graph natural language processing device according to claim 58, characterized in that it takes as input text in which a portion of the node token or edge token is replaced with hidden characters, and outputs the hidden characters.
63. The graph natural language processing device according to claim 58, characterized in that it takes the aforementioned text as input and outputs the features of the graph network.
64. The graph natural language processing device according to any one of claims 59 to 62, characterized in that the processing unit receives the training data, which is graph data, and abnormal data obtained by swapping the node types of the training data, determines the training data to be normal, and determines the abnormal data to be abnormal.
65. The graph natural language processing device according to 64, characterized in that the processing unit creates two or more abnormal data from one training data, and removes abnormal data that is graph-isolated with the training data or abnormal data that is graph-isolated between the abnormal data.
66. The graph natural language processing device according to any one of claims 59 to 62, wherein the graph network shown by the graph data relates to an inorganic compound, and the processing unit adds hydrogen atoms as nodes to nodes whose valence is less than the number of edges, and connects them to satisfy the valence.
67. The graph network shown by the graph data relates to mesh data of the finite element method, and the processing unit adds edges between adjacent nodes to nodes with a node order of 2 or less, thereby increasing the node order to 3 or more, as described in any one of claims 59 to 62.
68. The graph natural language processing device according to claim 58, characterized by comprising a whitespace tokenizer for splitting the text.
69. The graph natural language processing device according to claim 58, characterized by comprising a sentence piece tokenizer for dividing the text.
70. The graph natural language processing device according to any one of claims 59 to 63, characterized in that the processing unit learns the text using scratch learning with a natural language processing device.
71. The graph natural language processing device according to any one of claims 1 to 3, characterized in that a node token representing an empty node is set for the other end of an edge to which a node is connected only at one end.
72. The graph natural language processing device according to claim 1, characterized in that the graph data is a dataset in which the same node token is included in the graph network by changing the number of classifications of node types or the number of significant digits of node attributes.
73. The graph natural language processing device according to claim 1, characterized in that the graph data is a dataset in which the same edge token is included in the graph network by changing the number of classifications of edge types or the number of significant digits of edge attributes.
74. The graph natural language processing device according to claim 1, characterized in that the graph data is a dataset in which two or more different node tokens are included in the graph network by changing the number of classifications of node types or the number of significant digits of node attributes.
75. The graph natural language processing device according to claim 1, characterized in that the graph data is a dataset in which two or more different edge tokens are included in the graph network by changing the number of classifications of edge types or the number of significant digits of edge attributes.
76. A graph natural language processing method using a graph natural language processing device, comprising: a step of a graph data acquisition unit acquiring graph data; a step of a node extraction unit extracting nodes including node types and node attributes from the graph data; a step of an edge extraction unit extracting edges including edge types and edge attributes from the graph data; and a step of a processing unit outputting node tokens formed by combining the node types and node attributes extracted by the node extraction unit, edge tokens formed by combining the edge types and edge attributes extracted by the edge extraction unit, and text arranged in the order of the node tokens and edge tokens.
77. A program to cause a computer to function as: a graph data acquisition unit that acquires graph data; a node extraction unit that extracts nodes including node type and node attributes from the graph data; an edge extraction unit that extracts edges including edge type and edge attributes from the graph data; a node token formed by combining the node type and node attributes extracted by the node extraction unit; an edge token formed by combining the edge type and edge attributes extracted by the edge extraction unit; and a processing unit that outputs text in which the node token and the edge token are arranged.