Graph natural language processing device, graph natural language processing method, and program
The graph natural language processing device addresses biases in existing methods by converting graph data into text using node and edge tokens, enhancing efficiency and consistency in graph representation without relying on explicit IDs.
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 biases and inefficiencies due to arbitrary node and edge ID assignments, leading to exponential data augmentation requirements and inconsistent graph representations.
A graph natural language processing device that converts graph data into text by combining node and edge information into tokens, eliminating the need for explicit node and edge IDs, thereby reducing data inflation and ensuring consistent representation.
This approach allows for efficient conversion of graph data into text without artificially inflating data, maintaining graph integrity and improving generation efficiency by eliminating biases associated with ID assignments.
Smart Images

Figure JP2025007343_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 constituting a graph network, an extraction unit that extracts nodes containing node information from the graph data, and a processing unit that combines the node information and converts it into node tokens that are processed as a single word in natural language processing, and outputs text consisting of the node tokens arranged in order.
[0012] The graph natural language processing device according to this disclosure includes a graph data acquisition unit that acquires graph data constituting a graph network, an extraction unit that extracts edges including edge information from the graph data, and a processing unit that combines the edge information and converts it into edge tokens that are processed as one word in natural language processing, and outputs text in which the edge tokens are arranged.
[0013] The graph natural language processing device described herein combines node information and converts it into node tokens that are processed as a single word in natural language processing, and outputs text consisting of these node tokens, or combines edge information and converts it into edge tokens that are processed as a single word in natural language processing, and outputs text consisting of these edge tokens. As a result, node IDs and edge IDs are not required, so the graph natural language processing device described herein can create text data from graph data without artificially inflating the data by assigning node IDs or edge IDs to each different sequence of node IDs or edge IDs.
[0014] 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 (1) according to Embodiment 1. This is a flowchart showing a graph natural language processing method (2) according to Embodiment 1. This is a flowchart showing a graph natural language processing method (3) according to Embodiment 1. This is a flowchart showing a graph natural language processing method (4) according to Embodiment 1. This is a flowchart showing a graph natural language processing method (5) according to Embodiment 1. This is a diagram showing an example of a graph network 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 in Embodiment 3. This is a circuit diagram showing a circuit to be processed in Embodiment 6. This figure shows an example of a graph network in Embodiment 6 (1). This figure shows an example of a graph network in Embodiment 6 (2). This figure shows an example of a graph network in Embodiment 6 (3). This figure shows an example of a graph network in Embodiment 6 (4). This figure shows an example of a graph network in Embodiment 6 (5). This figure shows an example of a graph network in Embodiment 6 (6). This figure shows an example of a graph network in Embodiment 6 (7). This figure shows an example of a graph network in Embodiment 6 (8).
[0015] 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.
[0016] (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 includes a graph data acquisition unit 11, an extraction unit 12, and a processing unit 13. 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 extraction unit 12, and the processing unit 13. The computer's processor executes the information processing application read from the memory, thereby realizing each of the functions of the graph data acquisition unit 11, the extraction unit 12, and the processing unit 13. Note that when the processor is a CPU (Central Processing Unit), the memory often refers to RAM (Random Access Memory), which is memory used to temporarily store data or programs necessary for the computer's operation. When the processor is a GPU, the memory often refers to VRAM (Video Random Access Memory), which is memory with enhanced capabilities for high-speed processing of large amounts of data for image data.
[0017] (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.
[0018] 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.
[0019] (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.
[0020] 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" in a graph, the node type will be set to "atom," and the edges will be set to "bonds 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."
[0021] When representing a "molecule" in a graph, it is not necessary to assign the "atomic type" 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 include isotopic information in the graph. It should be noted that 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.
[0022] Node types or node attributes, and edge types or edge attributes, are not necessarily used to define graph data, but they are used to form the characteristics of 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 circuit components.
[0023] For example, when representing a "social network" as a graph, nodes represent "individuals" and edges represent "relationships between individuals." Furthermore, by representing "companies and users" as nodes and "products of a specific company" as edges, a graph can be constructed that links the relationship between companies and users based on the products used by those users. Thus, graphs are composed of nodes and edges.
[0024] (Extraction Unit) The extraction unit 12 extracts nodes containing node information from the graph data acquired by the graph data acquisition unit 11. For example, the extraction unit 12 extracts node information indicating the node type. 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 when people are represented by nodes in a graph representing a "social network". An example of a case where multiple types of nodes exist is when different entities such as people, places, or events are represented by nodes in a knowledge graph.
[0025] Furthermore, the extraction unit 12 extracts node attributes from the nodes included in the graph, which indicate the attributes of the nodes. 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.
[0026] The extraction unit 12 may extract 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 extraction unit 12 may also extract the edge IDs of the edges included in the graph data during processing by the processing unit 13. For example, in a multi-edge consisting of multiple edges connecting two nodes, the nodes connected to both ends of each edge are the same, so information about the nodes connected to both ends of the edge is not enough to uniquely identify each edge. In this case, by using an edge ID that exists only once in the graph, it is possible to uniquely identify each edge even if it constitutes a multi-edge.
[0027] (Processing Unit) The processing unit 13 combines the node information extracted by the extraction unit 12 and converts it into node tokens that are processed as one word in natural language processing, and outputs text in which the node tokens are arranged. For example, the processing unit 13 has a function to convert the node information into node tokens that can be divided into one word by a tokenizer, and a function to output text in which the node tokens of the nodes extracted by the extraction unit 12 are arranged. As for how the node tokens are arranged, for example, text can be output by arranging the node token of the node of interest (hereinafter referred to as the node of interest) and the node tokens of the nodes adjacent to the node of interest. When creating node tokens, the processing unit 13 may store the node token and the node ID or node name as a set, and may also store the edge ID or edge name and the node ID or node name as a set. This allows the processing unit 13 to uniquely identify the nodes connected to both ends of an edge selected from within the graph from the node ID or node name, and thus associate the edge with the node token.
[0028] The graph natural language processing device 1 may include a display processing device, which is not shown in Figure 1. For example, the display processing device generates display information for displaying the text data created by the processing device 13 and outputs the generated display information to a display device. The display device displays the text data created by the processing device 13 based on the display information. The display device may be a display device provided separately from the graph natural language processing device 1, or it may be a display unit provided by the graph natural language processing device 1. Furthermore, the display device may be a display unit provided by an external device that is communicated with the graph natural language processing device 1 via a network.
[0029] Further, the graph natural language processing device 1 may include an output unit (not shown in FIG. 1). The output unit outputs the text data created by the processing unit 13 to an external device. For example, the output unit outputs the text data created by the processing unit 13 to a graph neural network as graph data. The graph neural network is a neural network that learns a graph structure 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.
[0030] (Electric Circuit) When an electric circuit is represented as a graph, for example, circuit components such as resistors and semiconductors are set as node types, and circuit constants, model numbers, and design or manufacturing manufacturers of the circuit components are set as node attributes, and wiring between circuit components can be set with edges. Analog signals, digital signals, power supply signals, high-speed signals, or differential signals are set as edge types, and in addition to voltage or current, the direction of the current is set as an edge attribute. (Quantum Circuit) When a quantum circuit is represented as a graph, for example, qubits or quantum gates are set as node types, the state of the qubit or the type of the quantum gate is set as a node attribute, quantum operations or quantum entanglement are set as edge types, and the type of operation or the strength of the entanglement is set as an edge attribute.
[0031] (Social Network) When a social network is represented as a graph, for example, nodes represent individuals and companies, edges represent relationships between individuals or between individuals and companies, and nodes represent companies and individuals, and edges represent products of a specific company. Thereby, a graph can be constructed that associates the relationship between a company and a user with the products used by the user.
[0032] (Server Network) When a server network is represented as a graph, for example, servers are set as node types, server performance is set as a node attribute, optical fibers or LANs are set as edge types, and the version or number of the LAN such as Cat6 is set as an edge attribute.
[0033] (Transport Network) When representing a transport network as a graph, for example, a warehouse is set as the node type, the size of the warehouse is set as the node attribute, land, sea, or air is set as the edge type, and the maximum load capacity is set as the edge attribute.
[0034] (Physical Simulation) In physical simulations including the finite element method or the time-domain difference method (referred to as the FDTD method in the electrical field), and the boundary element method (referred to as the moment method in the electrical field), space is divided into polyhedra. Therefore, when the vertices of the polyhedron are used as nodes and the edges of the polyhedron are used as edges, it can be represented as a graph. For example, iron or resin is set as the node type, electrical properties such as coordinates or relative permittivity, and physical properties such as density or melting point are set as the node attributes, and the connection between nodes is represented by an edge. Thus, a graph representing the physical simulation can be created.
[0035] (Citation and Being Cited of Papers or Websites) When representing the citation and being cited of papers or websites as a graph, for example, a journal or a publisher is set as the node type, and the title or publication year of the paper is set as the node attribute. Also, whether it is a directional edge indicating citation or being cited is set as the edge attribute.
[0036] (Protein) When representing a protein as a graph, for example, about 20 types of amino acids such as valine, leucine, and isoleucine are set as the node type, the molar mass and acid dissociation constant are set as the node attributes, and the binding energy of the peptide bond is set as the edge attribute.
[0037] (Gene) When representing a gene as a graph, for example, nucleobases are set as the node type, the molar mass is set as the node attribute, and the binding energy of the hydrogen bond is set as the edge attribute.
[0038] (EC) When representing EC as a graph, for example, a product or a purchaser is set as the node type, and the model number of the product, the gender or nationality of the purchaser is set as the node attribute.
[0039] (Smart Grid) When representing a smart grid graphically, the node type is set to smart meters or power equipment, the node attribute is set to power consumption, current, or voltage, the edge type is set to power lines or communication lines, and the edge attribute is set to current or communication speed.
[0040] (Security) When representing security graphically, the node type is set to information about the device or user, or the application; the node attributes are set to communication volume, usage frequency, or connection status; the edge type is set to the network connection between network devices; the edge attributes are set to the network wiring name (ID), or the importance or frequency of communication.
[0041] (Brain) When representing the brain graphically, for example, the node type is set to motor neurons or complex cells, which are nerve cells, and the edge type is set to axons or dendrites. The edge attributes are set to the length or thickness of the axons or dendrites.
[0042] (Knowledge Graph) When a knowledge graph is represented graphically, for example, the node type may be set to a word such as a person's name or a place name, such as a proper noun, and the node attribute may be set to a name or gender if it is a person's name, or longitude, latitude, or altitude if it is a place name. In addition, the edge type may be set to a verb that indicates the relationship between words such as "residence," and the edge attribute may be set to additional information related to the edge type, such as the number of years of residence.
[0043] Thus, node types or node attributes, and edge types or edge attributes, are not necessarily used to define graph data, but they are used to form the characteristics of graph data. For this reason, many graph data have some of this data, especially node types or node attributes.
[0044] Furthermore, if the target node does not have node information, for example, the node type or edge type of adjacent nodes or edges to the target node is added as node information to the target node, and the node degree, which indicates the number of edges connected to the node, is added to the node attributes. This allows the target node to be characterized.
[0045] Furthermore, if the target edge does not have edge information, for example, the node type of the connecting node is used as the edge type, and a statistical value including the maximum or average node degree of the nodes connected to both ends of the edge, or the sum of the node degrees, is assigned as the edge attribute. This makes it possible to assign attributes to all edges, even those edges that do not have edge attributes in the dataset. Note that a graph is composed of nodes and edges. The extraction unit 12 extracts the nodes that the graph has based on the graph data acquired by the graph data acquisition unit 11.
[0046] Furthermore, the extraction unit 12 extracts node information from among the nodes in this graph data. The node information includes a node type, which has a finite number of discrete values, and node attributes, which have discrete values such as continuous values or integers, and there is no upper limit on the number of such attributes. In this case, the node type and node attributes do not have to be present, and a node may have two or more elements.
[0047] Furthermore, the extraction unit 12 extracts edge information from the edges of this graph data. The edge information includes edge types, which are finite discrete values, and node attributes, which are continuous or discrete values, and there may be no upper limit on the number of such attributes. If the node IDs or edge IDs do not remain in the text output by the processing unit 13, i.e., the text input to the natural language processing unit, the extraction unit 12 may extract node IDs or edge IDs to be used in intermediate processing during text creation.
[0048] A node ID is the unique node name that a single node possesses within the graph. Instead of a node name, a node number may be used for the node ID. Therefore, specifying a node ID determines one node, and specifying one node determines one node ID. An edge ID is the unique edge name that a single edge possesses within the graph. Therefore, specifying an edge ID determines one edge, and specifying one edge determines one edge ID.
[0049] Node IDs or edge IDs are necessary to process the graph. For example, when representing "molecules that make up a protein" in a graph, since each protein molecule contains multiple "carbons," multiple nodes will be selected just for the nodes representing "carbons." Therefore, if a protein has 1,000 carbons (assuming that one amino acid has an average of 5 carbon atoms, and 200 amino acids combine to form a protein), then even if node IDs are assigned only to carbon atoms, node IDs from C1 to C1000 will be necessary.
[0050] Furthermore, if we assign sequential IDs to nodes representing all atoms, for example, we would need to assign node IDs from atom1 to atom10000. For example, node information includes at least one of the following: node type, node attribute, node degree, or edge information of the connected edge. This allows general graph data to be converted into a string without node IDs. The same applies to edges; each edge has two node IDs assigned to the nodes connected at both ends, and a graph can be created by assigning an edge ID to each edge. That is, edge information includes at least one of the following: edge type, edge attribute, or node information of the connected node. This allows general graph data to be converted into a string without edge IDs.
[0051] By using the node IDs or edge IDs included in the graph in this way, each node ID or edge ID can be assigned node information such as node type or node attributes, or edge information such as edge type or edge attributes. However, in graph generation using natural language processing, there is a problem that the generated graph may be biased depending on the order of the node IDs or edge IDs.
[0052] The processing unit 13 combines the node information, including the node type and node attributes, extracted by the extraction unit 12 to create a node token. The processing unit 13 may also combine the edge information, including the node information for the nodes at both ends of the edge extracted by the extraction unit 12, to create an edge token. Furthermore, the graph natural language processing unit 1 may, during the intermediate processing when the processing unit 13 arranges the node tokens or edge tokens, hold a set of node tokens and node IDs, and a set of edge tokens and edge IDs.
[0053] However, node IDs and edge IDs must be replaced with node tokens and edge tokens respectively before inputting graph data into a natural language processing learning device. In a typical graph neural network, node IDs are not explicitly assigned to nodes. However, when converting a graph into a representation of a graph network, or into an adjacency matrix that can be processed in 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 if node A is not explicitly assigned a node ID, the integer M can be considered the node ID of node A.
[0054] In other words, since the diagonal elements of the M row and M column represent the presence or absence of a self-loop, the presence or absence of a connection between node A and other nodes can be represented, for example, by assigning "1" if there is a connection and "0" if there is no connection. In this case, for node A, the integer M can be considered as the node ID.
[0055] Furthermore, in graph neural networks, the adjacency matrix only represents the connections between nodes. Therefore, node information such as node type and node attributes cannot be assigned to the adjacency matrix. Instead, node information is assigned in association with the node ID within the adjacency matrix.
[0056] Therefore, it is also possible to hold a dataset representing node attributes, expressed in N rows and B columns, by combining it with an N x N adjacency matrix. The node ID is used to associate the elements of the adjacency matrix with the dataset representing the node attributes. B means that it is a node type classified into type B, and in graph neural networks, node attributes are assigned using one-hot vectors. For this reason, the same number of columns as node types are required.
[0057] Typically, node IDs are not explicitly assigned; instead, the row number of the adjacency matrix is made equal to the row number of the dataset representing the node information. Therefore, although not explicitly stated, for example, in large graphs, it can be difficult to place all the data into the computer's memory or GPU memory at once. For this reason, in large graphs, "subgraphs"—parts of the graph—are sometimes used. In this case, node IDs may be explicitly assigned.
[0058] In graph neural networks, an association is made between nodes corresponding to the adjacency matrix and node attributes. In this case, node IDs and graph data are closely related, and it is not obvious that node IDs can be replaced with node tokens in a graph or graph neural network. Furthermore, replacing node IDs with node tokens does not necessarily guarantee unity, unlike when node IDs are assigned.
[0059] Similarly, for edge IDs, it is necessary to store the position of the target edge in order to associate the row number of the adjacency matrix with the edge type or edge attribute, which is edge information. Specifically, since each edge has node IDs at both ends, if the number of edges is S, it can be represented by a 2 × S matrix. If T is a natural number between 1 and S (inclusive), then T can be considered the edge ID. Thus, every edge has an edge ID.
[0060] We have explained node IDs and edge IDs, and it is defined that node IDs and edge IDs have uniqueness, with only one per graph. Therefore, if it is possible to assign a unique name to each graph, node IDs can be substituted with node names, and edge IDs can be substituted with edge names.
[0061] Thus, generally, to represent a graph, node IDs and edge IDs that possess uniqueness are essential. In contrast, the inventors of this invention, upon examining graph representation, discovered that nodes or edges can be represented relatively by combining node tokens and edge tokens that do not necessarily possess uniqueness. This embodiment utilizes this characteristic.
[0062] Generally, a graph network consists of six elements: node ID, node type, node attributes, edge ID, edge type, and edge attributes. When generating a graph using natural language processing, there is a physical constraint that the six elements must be generated in a specific order or number for the graph to be formed. In other words, text that does not satisfy this physical constraint cannot be converted into a graph during text generation using natural language processing.
[0063] In contrast, the graph natural language processing device 1 according to Embodiment 1 replaces the node ID with a node token formed by combining the node type and node attribute, which are node information, and replaces the edge ID with an edge token formed by combining the edge type and edge attribute, which are edge information. For example, if there is one node type, one node attribute, one edge type, and one edge attribute, the node type and node attribute are combined to form a node token that can be processed as a single word in natural language processing, and the edge type and edge attribute are combined to form an edge token that can be processed as a single word in natural language processing. This is equivalent to replacing the node ID with a single word formed by combining the node type and node attribute, and replacing the edge ID with a single word formed by combining the edge type and edge attribute. This replacement reduces the six elements to four elements consisting of node ID, node token, edge ID, and edge token. Furthermore, by using a node token instead of a node ID and an edge token instead of an edge ID, the four elements become two elements: node token and edge token.
[0064] The two elements possess the remarkable characteristic that they can be converted from text into a graph regardless of the order in which they are generated. By utilizing this characteristic, a special effect can be obtained in which graphs with abnormal node attributes for node types and graphs with abnormal edge attributes for edge types are not generated, even without using node IDs and edge IDs.
[0065] So far, we have described the case where there is one node type, one node attribute, one edge type, and one edge attribute. However, even if there are, for example, two node types, one node attribute, two edge types, and one edge attribute, the processing unit 13 combines the two node types and one node attribute to create a node token that can be processed as a single word in natural language processing. Alternatively, it may combine two edge types and one edge attribute to create an edge token that can be processed as a single word in natural language processing. In particular, under the definition that nodes with the same node type and the same node attribute are converted into the same token, the order in which node types and node tokens are combined does not matter. This utilizes the characteristic that nodes with the same node type and the same node attribute can be learned if they are treated as the same token in natural language processing.
[0066] Even if there is only one node type and one edge type, and neither node nor edge attributes exist, node tokens and edge tokens can still be created. Furthermore, a graph created using only node information and no edge information will only have node tokens, and this graph can be represented as text. Additionally, edge information can be extracted based on the node information of the nodes connected to both ends of an edge, edge tokens can be created from the extracted edge information, and the graph can be represented as text by arranging the node tokens or edge tokens. Conversely, a graph formed using only edge information and no node information can be represented as text using only edge tokens. Also, similar to node tokens, edge types and edge tokens can be combined in any order, based on the definition that edges with the same edge type and the same edge attributes are converted into the same token.
[0067] Furthermore, even in graphs with edge information, the graph can be represented using only node tokens by including the edge information of the edges connected to a node in the node token corresponding to that node. Node tokens containing edge information have improved functionality as node IDs, and depending on the amount of information in the edge information or the similarity between edge information, many node tokens may be used only once within the dataset. Since it is desirable for at least one node token to be used more than once within the dataset, if this condition is not met, it is preferable to combine node tokens and edge tokens so that node tokens are used more than once, rather than representing the graph using only node tokens.
[0068] Similarly, with respect to edge tokens, even in graphs that contain node information, the graph can be represented solely by edge tokens by including the node information of the nodes connected to the edge in the edge token of that edge. Edge tokens containing node information have improved functionality as edge IDs, and depending on the amount of information in the node information or the similarity between the node information, many edge tokens may be used only once within the dataset. Since it is desirable for at least one edge token to be used more than once within the dataset, if this condition is not met, it is preferable to combine node tokens and edge tokens so that the edge token is used more than once, rather than representing the graph solely with edge tokens.
[0069] Furthermore, node information is extracted based on edge information connected to the nodes, and node tokens are created from the extracted node information. This allows the processing unit 13 to represent the graph in text by combining the node tokens and edge tokens.
[0070] Next, we will explain the four types of delimiters. The first is the "first delimiter" that separates node tokens or edge tokens. For example, the first delimiter may be a half-width space or two or more characters containing a half-width space. The second is a character that is not included in part of the node token, and is the "second delimiter" that separates the node of interest from the adjacent node when arranging the node tokens of the node of interest and the adjacent node. This must be a different delimiter from the first delimiter. That is, since the first delimiter is used to separate words in natural language processing, the first delimiter after separation is not recognized by natural language processing, whereas the second delimiter needs to be recognized as a single token by natural language processing. The third is a character that is not included in part of the node token that combines node information, i.e., the node type and node attribute, and is the "third delimiter" that separates the node type and node attribute. This can be anything as long as the node type and node attribute that constitute the node token can be extracted from the node token. The fourth is a character that is not included in the edge token formed by combining edge information, i.e., the edge type and edge attributes, and is the "fourth delimiter" that separates the node type and node attributes. This can be any character as long as the edge type and edge attributes that constitute the edge token can be extracted from the edge token. In other words, based on the criteria for determining whether each delimiter can become a token in natural language processing, only the second delimiter has the characteristic of becoming a token.
[0071] (Graph Natural Language Processing Method) Figure 2 is a flowchart showing a graph natural language processing method (1) according to Embodiment 1, illustrating a series of operations by the graph natural language processing device 1. The graph data acquisition unit 11 acquires graph data (step ST1). 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 extraction unit 12.
[0072] The extraction unit 12 extracts node information from the graph data acquired by the graph data acquisition unit 11 (step ST2). For example, the extraction unit 12 extracts the node type from the graph data as node information, and further extracts the node attributes. The processing unit 13 executes the creation process (step ST3). Here, the processing unit 13 combines the node information extracted by the extraction unit 12 and converts it into node tokens that are processed as one word in natural language processing, and outputs text with the node tokens arranged in order.
[0073] The processing unit 13 outputs text that arranges the node token of the selected node of interest from the created node tokens and the node tokens of nodes adjacent to the node of interest. The node of interest is a node selected by sequentially focusing on some or all of the nodes in the graph. Furthermore, the processing unit 13 may create node tokens by including edge information extracted from the graph data by the extraction unit 12 in the node information. In this way, a graph having node IDs, node types, and node attributes can be represented using only node tokens. This eliminates the need for constraints such as the number, position, or value to represent the graph structure when generating a graph based on natural language processing. In other words, all text consisting only of node tokens satisfies the physical constraints for constructing a graph, and since no unnecessary graphs that do not form a graph are generated during graph generation by the graph natural language processing device 1, the graph generation efficiency is improved. The processing unit 13 may also output text with different node tokens for one or more node tokens in the graph data. This increases the degree of freedom in graph representation in natural language processing.
[0074] Figure 3 is a flowchart showing a graph natural language processing method (2) according to Embodiment 1, illustrating a series of operations by the graph natural language processing device 1. 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 extraction unit 12.
[0075] The extraction unit 12 extracts edge information from the graph data acquired by the graph data acquisition unit 11 (step ST2A). For example, the extraction unit 12 extracts the edge type from the graph data as edge information, and further extracts the edge attributes. Based on the edge information, the extraction unit 12 extracts node information of the nodes connected to the edge corresponding to this edge information, and outputs the node information to the processing unit 13.
[0076] The processing unit 13 executes the creation process (step ST3A). Here, the processing unit 13 combines the information of each node to create a node token that is processed as a single word in natural language processing. The processing unit 13 outputs text in which the node token of the selected node of interest and the node tokens of the nodes adjacent to the node of interest are arranged. Note that a graph can be represented in text by sequentially designating some or all of the nodes in the graph as nodes of interest and combining the node tokens of the nodes of interest and adjacent nodes into text. In this case, only graphs containing directed nodes or directed edges can be designated as some of the nodes; in the case of an undirected graph, it is desirable to sequentially designate all nodes as nodes of interest. For example, if the node connected to the node of interest by one edge is considered an adjacent node, the graph can be represented by sequentially arranging the node token of the node of interest and the node tokens of one or more adjacent nodes. However, if the node token does not contain edge information, it is desirable to include a delimiter between the node of interest and adjacent nodes to distinguish between the node of interest and adjacent nodes. In this case, if a delimiter is included in the node token, the tokenizer in natural language processing will incorrectly split the node token, which should be treated as a single token, into two or more tokens, resulting in an unintended split.
[0077] Therefore, a string that is not included in the node token is defined, and the processing unit 13 replaces the delimiter in the node token with the string, so that the node token does not contain the same string as the delimiter. This allows the graph to be converted into text by separating the node of interest from adjacent nodes using the node token and delimiter. Since this satisfies the two conditions mentioned above, any text consisting only of node tokens and delimiters can be converted back into a graph.
[0078] Furthermore, it is desirable to use a first delimiter, which is a character not included in the delimiter or node tokens, between node tokens or between node tokens and delimiters. The first delimiter is a string that disappears when the tokenizer of the natural language processing unit is applied, and therefore is not included in the two elements. To represent a graph with node tokens, it is sufficient to use text that combines the node token, the first delimiter, and the delimiter. Alternatively, the processing unit 13 may replace the first delimiter within a node token with a first character not included in part of the node token, and output text that separates the node tokens with the first delimiter. For example, by replacing the first delimiter with, for example, a "half-width space" as the first character, it is possible to use a whitespace tokenizer, which allows for relatively fast partitioning, as the tokenizer for natural language processing. Furthermore, the processing unit 13 may replace the first delimiter in a node token with a first character that is not included in part of the node token and is not included in part of the edge token, replace the first delimiter in an edge token with the first character, and output text that is separated between node tokens, between edge tokens, and between node tokens and edge tokens by the first delimiter. This allows the tokenizer in natural language processing to freely choose characters or strings that serve as markers when dividing text into words.
[0079] Furthermore, the processing unit 13 may output text in which the node token of the node of interest and the node tokens of nodes adjacent to the node of interest in the graph network are arranged using a second delimiter that is not included in part of the node token. For example, the second delimiter distinguishes the node tokens of the node of interest and adjacent nodes. Also, even when using a second delimiter, the graph can be represented by a two-element token composed of a node token and a second delimiter, so the text generated by natural language processing can be converted into a graph.
[0080] Furthermore, the processing unit 13 may output text in which a second delimiter different from the first delimiter is used to separate the node tokens and the node tokens and the second delimiter using the first delimiter. This allows the tokenizer in natural language processing to divide the text into words using the first delimiter as a marker. The processing unit 13 may also output text in which node information at both ends of an edge is used, a third delimiter not included in part of the node token formed by combining the node information is used, and an edge token formed by combining the node token and the third delimiter is used. This allows the edge token to represent a graph, as the left side of the third delimiter contains node information for the node connected to one end of the edge, and the right side contains node information for the node connected to the other end. Node information for the nodes connected to both ends of an edge can be extracted from the edge token generated by natural language processing without processing errors. Note that part of the third delimiter does not include the first delimiter. This prevents a tokenizer that divides text into words by focusing only on the first delimiter from focusing on the third delimiter.
[0081] Figure 4 is a flowchart showing a graph natural language processing method (3) according to Embodiment 1, illustrating a series of operations by the graph natural language processing device 1. The graph data acquisition unit 11 acquires graph data (step ST1B). For example, if an external server manages the graph data, the graph data acquisition unit 11 connects to 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 extraction unit 12.
[0082] The extraction unit 12 extracts edge information from the graph data acquired by the graph data acquisition unit 11 (step ST2B). For example, the extraction unit 12 extracts edge types from the graph data as edge information, and further extracts edge attributes. The processing unit 13 executes the creation process (step ST3B). Here, the processing unit 13 combines the edge information extracted by the extraction unit 12 and converts it into edge tokens that are processed as one word in natural language processing, and outputs text consisting of the edge tokens. For example, the processing unit 13 combines edge information including node information at both ends of an edge and converts it into the above edge tokens.
[0083] The edge tokens created by the processing unit 13 can be processed as a single token by the text segmentation using a natural language processing tokenizer. This eliminates the need for constraints such as the number, position, or value required to represent the graph structure when generating a graph based on natural language processing. Furthermore, all text consisting only of edge tokens satisfies the physical constraints for constructing a graph, and since no unnecessary graphs that do not form a graph are generated during graph generation by the graph natural language processing device 1, the efficiency of graph generation is improved. The processing unit 13 may also output text with different edge tokens for one or more edge tokens in the graph data. This increases the degree of freedom in graph representation in natural language processing. In addition, the processing unit 13 may replace the first delimiter in an edge token with a first character not included in part of the edge token, and output text with the edge tokens separated by the first delimiter. For example, by replacing the first delimiter with, for example, a "half-width space" as the first character, it is possible to use a whitespace tokenizer, which enables high-speed segmentation, as the tokenizer for natural language processing.
[0084] Figure 5 is a flowchart showing a graph natural language processing method (4) according to Embodiment 1, illustrating a series of operations by the graph natural language processing device 1. The graph data acquisition unit 11 acquires graph data (step ST1C). 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 extraction unit 12.
[0085] The extraction unit 12 extracts node information from the graph data acquired by the graph data acquisition unit 11 (step ST2C). For example, the extraction unit 12 extracts the node type from the graph data as node information, and further extracts the node attributes. The processing unit 13 executes the creation process (step ST3C). Here, the processing unit 13 creates edge tokens containing the extracted node information. At this time, the processing unit 13 can convert the graph into text that can be divided into individual edge tokens by the tokenizer by arranging the edge tokens using a delimiter. For example, the processing unit 13 outputs text that arranges the node token of the selected node of interest from the created node tokens and the node tokens of nodes adjacent to the node of interest.
[0086] Figure 6 is a flowchart showing a graph natural language processing method (5) according to Embodiment 1, illustrating a series of operations by the graph natural language processing device 1. The graph data acquisition unit 11 acquires graph data (step ST1D). 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 extraction unit 12.
[0087] The extraction unit 12 extracts node information from the graph data acquired by the graph data acquisition unit 11, and further extracts edge information (step ST2D). For example, as node information, the extraction unit 12 extracts node types and node attributes from the graph data. Furthermore, as edge information, the extraction unit 12 extracts edge types and edge attributes from the graph data.
[0088] The processing unit 13 executes the creation process (step ST3D). The processing unit 13 creates node tokens based on node information and edge tokens based on edge information. Then, the processing unit 13 outputs text containing at least one of the node tokens and edge tokens. At this time, there are two methods: one that focuses on one node token and arranges the edge tokens of the edges connected to the node of the node token, and another that focuses on one edge token and arranges the node tokens of the nodes connected to the edges of the edge token. These are called node-center representation and edge-center representation, respectively.
[0089] (Node-centered representation) In node-centered representation, all nodes included in the graph are treated as focus nodes in order, and the edges connected to these focus nodes are arranged accordingly. That is, the processing unit 13 outputs text consisting of the node tokens of the focus nodes and the edge tokens of the edges connected to them. Here, the order of the focus nodes and the edge tokens of the edges connected to them does not matter, but for example, if the text is created in the order of focus node, then connecting edge, it will result in a string where zero or more edge tokens are placed consecutively around a single node token. Therefore, in node-centered representation, the text will consist of a repeating pattern of one node token and zero or more edge tokens, such as the node token of the first focus node, one or more edge tokens, then the node token of the second focus node. When two or more node tokens appear consecutively, the first node token is treated as a node without edges, allowing all generated text to be converted into a graph.
[0090] (Edge-centered representation) Edge-centered representation is a method of arranging all edges contained in a graph as focus edges in order, and the nodes connected to the focus edges. That is, the processing unit 13 outputs text that arranges the edge token of the focus edge and the node tokens of the nodes connected to both ends of the focus edge in the graph network. Embodiment 1 will be described assuming that there are nodes at both ends of the edge. The order of the focus edge and the node tokens connected to that edge does not matter, but for example, if the text is created in the order of focus edge, connected node, it will be a string in which the two node tokens at both ends of the edge are placed consecutively for one edge token. In node-centered representation and edge-centered representation, in a graph with two or more nodes or edges, the focus node or focus edge is changed so that all nodes or edges in the graph become a focus node or focus edge once each. If necessary in the intermediate processing of extracting edges connected to a node, or the intermediate processing of extracting nodes at both ends of an edge, the node ID or edge ID may be obtained. In other words, by extracting the node ID designated as the node of interest, extracting the edge IDs connected to that node ID, and extracting the node IDs other than the node ID of the node of interest to which those edge IDs are connected, adjacent nodes can be extracted.
[0091] Furthermore, edge IDs designated as "edges of interest" are extracted, node IDs connected to those edge IDs are extracted, and the node tokens associated with those node IDs are listed alongside the edges 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.
[0092] If the text created by the processing unit 13 does not contain node IDs, node names, edge IDs, and edge names, then it is acceptable to retain all node IDs and node names, and edge IDs and edge names. Graph data can vary depending on the dataset, with some having node types or node attributes, and others not. The following explanation assumes that node information includes node types and node attributes. Note that the graph natural language processing method according to Embodiment 1 can be applied to datasets that only have node types and no node attributes, or datasets that only have node attributes and no node types. For example, in the case of a dataset with only node types, the node token may be assigned a string meaning "none," such as "None," to the node attribute.
[0093] A single node may have multiple node types, or multiple node attributes. For example, if a node has multiple node types, the node types can be listed to form a node token. However, nodes of the same node type with the same node attributes must have node tokens composed of the same string. For this reason, for example, the processing unit 13 connects different edge tokens composed of the same string to different node tokens composed of the same string. Alternatively, the number of edges connected to a single node and edge information may also be included in the node token. If edge information is included, the order in which the node type, node attributes, and edge information are described must be defined, and different node tokens with the same conditions must have the same string.
[0094] Furthermore, if the 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 create a node token, or the node type alone may be used as the node token. If a node exists at only one end of an edge, it is desirable to define a new node token to represent an empty node. This allows all edges to be considered to have nodes at both ends, resulting in text that can be processed using natural language processing. In other words, this text is processed using natural language processing as if there were nodes at both ends of the edges, making it less likely to generate abnormal graphs. Thus, even when nodes are not necessarily at both ends of an edge, the graph natural language processing method according to Embodiment 1 can be applied.
[0095] The same applies to edge tokens. Graph data can contain various types of data, depending on the dataset, such as data with or without edge types or edge attributes. Regardless of the type of data, the processing unit can output text representing the graph data. Hereafter, edge information will be described assuming data with edge types and edge attributes. Note that the graph natural language processing method according to Embodiment 1 can be applied to datasets that have only edge types and no edge attributes, or datasets that have only edge attributes and no edge types. For example, in the case of data with only edge types, the edge token may be assigned a string meaning "none," such as "None," to the edge attribute.
[0096] Furthermore, if all edge attributes are unavailable, edge tokens may be created using only the edge type, without using edge attributes. However, when forming edge tokens using only the edge type, there is a possibility of multiple identical edge tokens being generated, making them unsuitable as substitutes for edge IDs. In such cases, edge tokens can be constructed by using statistical values such as the maximum or average node degree of both ends of the edge, or the sum of the node degrees, as edge attributes.
[0097] Furthermore, a single edge may have multiple edge types, or a single edge may have multiple edge attributes. For example, if there are multiple edge types, the edge types can be listed together to form a single edge token. However, the node information, such as node types or node attributes, can be increased or decreased, or the edge information, such as edge types or edge attributes, can be increased or decreased. Furthermore, the processing unit 13 may output text containing the same node token two or more times for one or more node tokens in graph data having one or more graph networks. For example, by adding the node degree as a new element to the node attributes, all identical node tokens can be separated into different node tokens two or more times. This allows for an increase in node information.
[0098] The extraction unit 12 extracts edges containing edge information from the graph data, and the processing unit 13 converts the edge information into edge tokens by combining them into a single word, and outputs text that arranges the node tokens and edge tokens, which are processed as different words in natural language processing. Alternatively, one node in the graph may be designated as a selected node, and the distance from the selected node may be used as an element of a new node attribute. This makes it possible to create different node tokens even if there are two or more identical node tokens, and by designating two or more selected nodes, it is possible to create a graph that does not have any identical node tokens, regardless of the type of graph. The distance is, for example, Euclidean distance. However, any distance based on the target graph data is acceptable, such as electrical length for circuits or propagation distance for wireless communication.
[0099] Furthermore, the amount of node information can be increased by combining the node degree, edge information, or selected nodes mentioned above. By further subdividing in this way, it is also possible to use node tokens created from the node information as node IDs. However, in datasets with only one graph (called transductives), if there are no more than two identical node tokens, learning and inference using natural language processing becomes difficult.
[0100] Furthermore, in a dataset with multiple graphs (called an inductive), if the nodes of the multiple datasets do not share at least two common nodes, learning and inference using natural language processing becomes difficult. This is because, in natural language processing, every word appears only once in a sentence. In this case, once one token is determined, the next token is automatically determined as one, thus reducing the degree of freedom in generation.
[0101] Therefore, in datasets containing only a single graph, node tokens are structured so that at least one node token included in that graph appears at least twice. Similarly, in datasets consisting of multiple graphs, node tokens are structured so that at least one node token representing each of the multiple graphs appears at least twice. This allows for limiting the significant figures of numerical values in node attributes by rounding them down, ensuring that each dataset contains at least two identical node tokens. This enables aggregation by node type, deletion of numerical or node type information, or adjustment of the coarseness of graph information to compensate for data augmentation.
[0102] For example, regarding significant figures, if a node attribute has information with 5 significant figures, 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 there are node tokens "A: 1.9453" and "A: 5.4532" with 5 significant figures, by reducing the significant figures to 2, we can obtain two or more identical node tokens as node tokens "A: 1.9" and "A: 5.5".
[0103] Regarding aggregation of node types, types or attributes with similar characteristics can be treated as a single group. For example, if there is not enough data in the periodic table of elements to define a new node type for all atoms, they can be aggregated into 18 groups. For instance, carbon (C), silicon (Si), and germanium (Ge) belong to group 14, so these node types are aggregated as group 14.
[0104] When node types and edge types are a finite number of discrete values that can be classified, the removal of numerical values or node types or edge types in a dataset can be done if the presence of numerical values or node types or edge types makes the node or edge information too granular.
[0105] So far, we have shown how to create identical node tokens by reducing the information contained in the dataset, that is, by degrading the information.In Embodiment 4, which will be described later, we show how to augment data by rearranging node tokens with the same conditions based on one or more indicators such as node degree or distance from a selected node.In Embodiment 5, which will be described later, we combine data augmentation with node tokens whose node attributes have been changed to have two or more identical node tokens in the dataset without degrading the information.These methods of using data augmentation are desirable embodiments if computing resources allow.
[0106] The processing unit 13 may change node tokens represented by the same string that are connected to edge tokens represented by the same string that are connected to node tokens represented by the same string that are connected to node tokens represented by the same string that are connected to node tokens represented by the same string that are connected to both ends of the edge to node tokens represented by the same string that are connected to node tokens represented by the same string that are connected to both ends of the edge to edge tokens represented by the same string that are connected to node tokens represented by the same string that are connected to both ends of the edge, by adding statistical values such as the maximum or average value of the node degrees of the nodes connected to both ends of the edge, the distance from one or more selected nodes selected from the graph network, or node information of the nodes connected to both ends of the edge. By adding statistical values such as the maximum or average value of the node degrees of the nodes connected to both ends of the edge, or the sum of the node degrees of the nodes connected to both ends of the edge, as new edge attributes, even if there are two or more identical edge tokens, they can be treated as different edge tokens. This makes it possible to increase the amount of edge information. Alternatively, by using the node tokens at both ends of the edge as node information, or by defining one node included in the graph as a selected node and using the distance from the selected node as an element of the new edge attribute, even if there are two or more identical edge tokens, they can be treated as different edge tokens. Furthermore, by defining two or more selected nodes, it is possible to create a graph in which no two edges share the same edge token, regardless of the type of graph.
[0107] Furthermore, edge information may be a combination of statistical values such as the maximum or average node degree, the sum of node degrees, node information of nodes connected to both ends of the edge, or selected nodes. This allows for the subdivision of edge information, and as a result, the edge token created from the edge information can be used as the edge ID.
[0108] However, in datasets with only one graph, if there are no more than two identical edge tokens, natural language processing (NLP) inference becomes difficult. Similarly, in datasets with multiple graphs, if there are no more than two common nodes on the edges of the multiple datasets, NLP inference also becomes difficult. In these cases, in natural language processing, every word is used only once, which reduces the degree of freedom in generation or makes it difficult to generate normal text.
[0109] Therefore, in a dataset consisting of only a single graph, the edge tokens are configured such that at least one edge token included in that graph appears two or more times. That is, the processing unit 13 outputs text containing the same edge token two or more times for one or more edge tokens in graph data that has one or more graph networks. Furthermore, in a dataset consisting of multiple graphs, it is desirable to configure the edge tokens such that at least one edge token representing the multiple graphs appears two or more times.
[0110] To ensure that a dataset consisting of a single graph contains at least two identical edge tokens, the coarseness of graph information may be adjusted by rounding the significant figures of the numerical values of edge attributes, aggregating by edge type, deleting numerical or edge type information, or augmenting the data.
[0111] For example, regarding significant figures, if the edge attribute has information that it has 5 significant figures, and there are 1,000 edges of the same edge type, the probability of two edge tokens being identical becomes low. In that case, for example, if the edge tokens with 5 significant figures are "A: 1.9453" and "A: 5.4532", by reducing the significant figures to 2, we can obtain two or more identical edge tokens as edge tokens "A: 1.9" and "A: 5.5".
[0112] The aggregation of edge types will be explained using "hydrogen bonds" as an example. There are "intermolecular hydrogen bonds" and "intramolecular hydrogen bonds." Intermolecular hydrogen bonds are hydrogen bonds that connect molecules, such as water molecules, while intramolecular hydrogen bonds are hydrogen bonds that form a double helix structure, such as DNA. In this case, these can be aggregated together as a single type of hydrogen bond.
[0113] Regarding the removal of numerical or edge information, if the presence of numerical values or edge types in the dataset prevents the creation of identical edge tokens, this can be addressed by removing that information.
[0114] So far, we have shown how to create identical edge tokens by coarsening, or degrading, the information contained in the dataset.In Embodiment 4, which will be described later, we show how to augment data by rearranging edge tokens with the same conditions based on one or more indicators such as the sum of the node degrees of the nodes connected to both ends of the edge, statistical values such as the maximum or average of the node degrees of both ends, the distance from the selected node, or, for nodes that have terminal numbers, the terminal number.In Embodiment 5, which will be described later, we have two or more identical edge tokens in the dataset without degrading information by combining data augmentation with edge tokens whose edge attributes have been changed.These methods of data augmentation are desirable embodiments if computing resources allow.
[0115] The level of detail or coarseness of node tokens and edge tokens depends on whether the graph is represented using only node tokens or only edge tokens. As mentioned above, this requires the subdivision and aggregation of node tokens or edge tokens.
[0116] On the other hand, it is also possible to represent a graph by combining node tokens and edge tokens, in which case it is desirable that no edge tokens consisting of the same string are connected to two or more node tokens consisting of the same string.
[0117] Furthermore, in Embodiment 2, which will be described later, a special effect is obtained in that the graph can be converted into a simple graph that does not contain self-loops or multiple edges, and a complete graph can be created from text generated by natural language processing.
[0118] Figure 7 shows an example of a graph network in Embodiment 1. Referring to Figure 7, the node token representation, edge token representation, node center representation, and edge center representation will be explained. The node token representation converts the graph into text using only node tokens. The edge token representation converts the graph into text using only edge tokens. The node center representation converts the graph into text using the node token of the node of interest and the edge tokens of the edges connected to the node of interest. The edge center representation converts the graph into text using the edge token of the edge of interest and the node tokens of the nodes at both ends connected to the edge of interest.
[0119] (Node Token Representation) Figure 7 is a graph composed of four nodes and four edges. This graph has a node with node type A and node attribute 1000, a node with node type B and node attribute 1, a node with node type B and node attribute 10, and a node with node type C and node attribute 100. For these nodes, node tokens are formed by combining the node type and node attribute. Specifically, if we define a colon ":" as the delimiter between the node type and node attribute, the node tokens will be "A:1000", "B:1", "B:10", and "C:100".
[0120] In contrast, there are four edge IDs. The edge with "ID: 1" is connected to nodes with node tokens "C: 100" and "A: 1000". The edge with "ID: 2" is connected to nodes with node tokens "B: 1" and "B: 10". The edge with "ID: 3" is connected to nodes with node tokens "A: 1000" and "B: 10". The edge with "ID: 1" is connected to nodes with node tokens "B: 10" and "C: 100". If the delimiter between the node of interest and adjacent nodes is ":::", the text will be as follows: A: 1000 B: 10 C: 100::: B: 1 B: 10::: B: 1 B: 1 A: 1000 C: 100::: C: 100 A: 1000 B: 10
[0121] In this case, the text, in which the delimiters between node tokens and between node tokens and delimiters are represented as " " (half-width spaces) for clarity, is as follows: A:1000 B:10 C:100:::B:1 B:10:::B:10 B:1 A:1000 C:100:::C:100 A:1000 B:10
[0122] However, this method can increase the number of node token types by creating unintended node tokens, such as "C:100:::B:1". While it is possible for natural language processing tokenizers to split both the delimiter " " and the delimiter ":::", if the string is continuous like ":::", incorrect splitting is likely to occur, resulting in the creation of an empty token " ".
[0123] Therefore, if we introduce another delimiter between node tokens and between node tokens and delimiters, for example, if we set the other delimiter to "&&&", the above text becomes as follows: A:1000&&&B:10&&&C:100&&&:::&&&B:1&&&B:10&&&:::&&&B:10&&&B:1&&&A:1000&&&C:100&&&:::&&&C:100&&&A:1000&&&B:10
[0124] By preventing an increase in the number of node token types in this way, efficient learning can be performed from a single data set, thereby improving generation accuracy. However, the node tokens of the node of interest are "A:1000", "B:1", "B:10", and "C:100". These become ":::&&&B:1" for "B:10", ":::&&&B:10" for "B:10", and "C:100" for ":::&&&C:100". In contrast, the initial "A:1000" does not contain ":::&&&", and without special processing, "A:1000" cannot be identified as the node of interest.
[0125] Therefore, to start the string with ":::&&&" and ensure that the first node token "A:1000" is the node of interest, you may output a string like the following: :::&&&A:1000&&&B:10&&&C:100&&&:::&&&B:1&&&B:10&&&:::&&&B:10&&&B:1&&&A:1000&&&C:100&&&:::&&&C:100&&&A:1000&&&B:10
[0126] The delimiter "&&&" can be any character or string that is different from all the node tokens, the delimiter ":::", the text composed of combinations between node tokens, or the text composed of combinations of node tokens and the delimiter ":::", for use in the natural language processing tokenizer.
[0127] If the delimiter "&&&" is replaced with a half-width space, a whitespace tokenizer can be used as the tokenizer for natural language processing. However, since some datasets contain half-width spaces in their node tokens, you may choose a character other than a half-width space as the string to replace the delimiter "&&&". Alternatively, you can replace the half-width spaces in the node tokens with a character other than a half-width space, such as a tab "\t", and use a half-width space instead of the delimiter "&&&". Furthermore, if you use "&&&" as the delimiter, you should use a tokenizer that is defined to split the string into words using "&&&". In this way, as long as you do not use a half-width space as the delimiter, you can use a half-width space as a character included in the node token.
[0128] Using a tokenizer, the above string can be broken down into a sequence of words as follows. For clarity, the separated words are shown separated by line breaks below. ::: A:1000 B:10 C:100 ::: B:1 B:10 ::: B:10 B:1 A:1000 C:100 ::: C:100 A:1000 B:10
[0129] By replacing each word extracted from the string with a numerical value using a tokenizer, natural language processing becomes possible. This preserves the physical constraints necessary for constructing the graph. Furthermore, by splitting the text into elements consisting of only two types of words—node tokens or the delimiter ":::"—using the tokenizer, natural language processing can be applied to the graph.
[0130] (Edge Token Representation) The case where node tokens are formed by combining node type and node attribute for the nodes in Figure 7 will be explained. Specifically, if the delimiter for grouping node information is defined as a colon ":", the node tokens will be "A:1000", "B:1", "B:10", and "C:100". There are also four edge IDs, and the node tokens "C:100" and "A:1000" are connected to edge "ID:1", and the node tokens "B:1" and "B:10" are connected to edge "ID:2", the node tokens "A:1000" and "B:10" are connected to edge "ID:3", and the node tokens "B:10" and "C:100" are connected to edge "ID:1".
[0131] As a result, if a delimiter different from the delimiter ":" used within the edge token is used, for example, "-", then the edge tokens become "C:100-A:1000", "B:1-B:10", "A:1000-B:10", and "B:10-C:100". In this case, if a delimiter different from the delimiter ":" or "-" is used between the edge tokens, for example, a space " ", then the text output from the processing unit 13 will be as follows: C:100-A:1000 B:1-B:10 A:1000-B:10 B:10-C:100
[0132] The delimiter " " between edge tokens can be any character or string that can be used as a delimiter by a natural language processing tokenizer, is not included in any of the edge tokens, and does not result from any combination of edge tokens.
[0133] When the delimiter " " is a half-width space, it is preferable to use a whitespace tokenizer. However, similar to node token representation, if the delimiter is, for example, "&&&", then when "&&&" appears in the text, a tokenizer that splits the edge tokens before and after "&&&" can be used, allowing for free selection of the delimiter. Thus, a key feature is that half-width spaces can be used to create node tokens or edge tokens without using them as delimiters.
[0134] In particular, the processing unit 13 outputs text containing delimiters, but in natural language processing, only the strings before and after the delimiter "&&&" are considered, and the tokens obtained by dividing the text into edge tokens do not include the delimiter "&&&". Also, the delimiter ":" or the delimiter "-" are grouped into tokens, and in natural language processing, these tokens are replaced with numerical values. Therefore, the numerical values representing the grouped tokens are unrelated to natural language processing and can be freely selected. In other words, the delimiter "&&&" is not included as a token in the learning or inference of the natural language processing unit, and the generated text does not include a token representing the delimiter "&&&". However, the delimiter "&&&" can be used in post-processing after natural language processing inference, which involves converting the generated sequence of tokens back into the original edge tokens and representing those edge tokens as strings.
[0135] The delimiter "&&&" used for tokenizer recognition and the delimiter used in the text generated by natural language processing do not necessarily have to be the same. Therefore, any character or string can be used as a delimiter as long as it can be correctly recognized by natural language processing. Note that a half-width space " " is often the most easily recognizable delimiter by humans, so you may change it if necessary.
[0136] (Node-centered representation) Node types are described as a finite number of discrete values that can be classified into categories, and node attributes are described as continuous or discrete values associated with the node type. For example, when representing "social networks" in a graph, node types can be set to nationality or gender, and node attributes can be set to age, height, weight, etc.
[0137] Furthermore, each individual can be assigned a unique node ID. However, if the node ID is used as a name, unity may not be maintained if there are people with the same name. In other words, selecting one node ID may not assign it to a single node.
[0138] By changing the node names of nodes that lack unity, it is possible to address the issue of not being able to assign a single node to a particular node. However, there is a degree of freedom in how node names are changed, as there is an element of discretion in how they are changed. For example, if there are two people with the same name, assigning "_1" to one and "_2" to the other ensures unity, but there is also the freedom to assign "_2" to one and "_1" to the other. When generating text representing a graph using natural language processing, nodes with "_1" are more likely to be generated, resulting in inequality between nodes. To eliminate this inequality, it is necessary to create text with the same number of combination changes as permutations by augmenting the data.
[0139] However, if, for example, there are 10 people with the same name, there are 10 factorial (10!) possible permutations. Therefore, to represent the 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 in natural language from the perspective of computational complexity and required memory. This is a major problem, for example, in graphs representing "molecules" or "genes," which have a small number of node types. Molecules contain many carbon or hydrogen atoms, so there can be many combinations of node IDs to assign.
[0140] Furthermore, when representing DNA or RNA graphically, DNA or RNA is composed of only five types of nucleic acid bases (adenine, guanine, cytosine, thymine, and uracil), and many identical nucleic acid bases exist. This results in a high degree of arbitrariness in assigning node IDs. For example, it is known that the human base sequence consists of approximately 300 million combinations of four types of bases: adenine, guanine, cytosine, and thymine. If, for example, there are 100 million combinations of a single base sequence, then data augmentation would require the generation of 100 million factorial texts, which cannot be learned with realistic computation time and resources.
[0141] Furthermore, in text generation, nodes assigned the first ID are more likely to be generated. This creates an inequality where the node assigned the 100 millionth ID, or the edges connected to it, are less likely to be generated, even if they possess the same characteristics as the first node or edge. While such inequality can still result in a normal graph, the generated graph will be biased. Data augmentation to eliminate this inequality requires learning exponentially increasing text, which is not feasible in terms of realistic time and cost.
[0142] Therefore, in the graph natural language processing device 1 according to Embodiment 1, based on the idea that node IDs and edge IDs are essential for managing graph data but hinder graph generation, node tokens combining node type and node attribute are introduced instead of node IDs, and edge tokens combining edge type and edge attribute are introduced instead of edge IDs.
[0143] For example, if we only consider node types, there are often multiple identical nodes. When representing social work in a graph, setting the node type to "people of the same nationality" is not a substitute for a node ID that requires uniqueness, because in large graph data, there will be many people of the same nationality.
[0144] Similarly, with respect to node attributes, there are many node attributes set for people with the same height and weight, and they cannot replace the uniqueness of a node ID. However, by utilizing the fact that combining node types and node attributes improves uniqueness, it can serve as a substitute for a node ID. That is, by setting nationality, height, and weight to a single node and calling this node a node token, the node token can possess enough uniqueness to serve as a substitute for a node ID.
[0145] Furthermore, combining elements such as gender, age, and place of residence, in addition to nationality, improves the unity of node tokens, making them a substitute for node IDs. This allows for the representation of text in graphs without using node IDs, and consequently, the conversion of graphs into text. Similarly, combining edge types and edge attributes improves unity and can potentially serve as a substitute for edge IDs. However, node tokens and edge tokens alone are insufficient for ensuring unity, and learning based on perceived unity is difficult.
[0146] However, even nodes that lack unity can have their characteristics determined by their relative relationships with surrounding nodes, allowing them to be converted to text without losing the characteristics of the graph data. In other words, by representing the node of interest with the edge tokens of the edges connected to that node, the relative relationships between nodes and edges can be defined. This improves unity and provides functionality equivalent to node IDs and edge IDs.
[0147] In conventional graph representations, the graph is defined based on node IDs, node types, node attributes, and connections between nodes via edges, resulting in redundant text representing the graph. In contrast, the graph natural language processing device 1 according to Embodiment 1 combines node types and node attributes, defining nodes relatively using edge tokens, thereby indicating that node IDs can be replaced.
[0148] In Embodiment 1, when creating a node token by combining node types and node attributes, or when creating an edge token by combining edge types and edge attributes, a colon ":" is used as a delimiter for clarity. If node types and node attributes can be extracted from a node token, and edge types and edge attributes can be extracted uniformly from an edge token, the delimiters that make up the node token and edge token do not necessarily need to be used.
[0149] For example, if all node types included in the test data are known, and even after combining node types and node attributes, only the node type can be extracted as a single node type, then a delimiter is unnecessary. When representing "social networks" in a graph, the country names are limited, all node types representing country names can be known, and height can also be represented numerically, so the node token can be represented without a delimiter, for example, as "nationality height". Also, even if the order of node types and node attributes is reversed, if this is consistently reversed across all graphs in the dataset, the node token can be represented as "height nationality". Even with a node token represented in this way, the node token can still be split into nationality and height.
[0150] By replacing all nodes in the graph data with node tokens in this way, the need to create text by augmenting data to resolve the aforementioned inequality is eliminated. This reduces the computational cost required for text creation and processing, and enables processing in natural language.
[0151] Furthermore, we will explain the additional effects obtained by creating node tokens. While node types and node attributes are required to be related values, text generation using natural language processing does not always guarantee that related values will be output. For example, in a graph representing a "social network," there may be instances where a value that should be associated with "height (m)" is set in the text, but "weight (kg)" is set instead during graph generation. Additionally, abnormal data may be generated with incorrect combinations of "height" and "weight." Furthermore, data may be generated with only "height" and no "weight," or multiple data points may be generated with only "height" set. Text converted from these graphs cannot be used to reconstruct the graph. Therefore, the above text must be treated as abnormal data where the physical constraints for graph construction are not maintained, and such text significantly reduces graph generation efficiency. Moreover, it is difficult to determine whether data with abnormal height and weight combinations is abnormal or not.
[0152] In contrast, the graph natural language processing device 1 according to Embodiment 1 combines node types and node attributes into a single word, which is then treated as a single token in natural language processing. For example, the processing unit 13 outputs text that has a reversible transformation relationship with the graph data with respect to at least the number of nodes and the number of edges. "Having a reversible transformation relationship with respect to at least the number of nodes and the number of edges" means that when the graph data is converted into text by the processing unit 13 and that text is converted back into graph data, the number of nodes and edges are the same in the original graph data and in the graph data after the conversion and inverse conversion. This allows for learning of natural language processing while maintaining physical constraints, and furthermore, because the text is generated while maintaining physical constraints, it has the unprecedented special effect of allowing all generated text to be converted back into a graph. Alternatively, the processing unit 13 may output text that has a reversible transformation relationship with the graph data with respect to at least the number of nodes and the number of edges. The same effect can be obtained in this way as well.
[0153] 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 extraction unit 12, edges are extracted from the graph data. The edge types are similar to the node types, and the edge attributes are similar to the node attributes.
[0154] It is desirable to assign a finite number of discrete values to edge types. For example, when representing molecules graphically, edge types can be set to include interatomic bonds such as covalent bonds, ionic bonds, metallic bonds, van der Waals forces, polar attractive forces, or hydrogen bonds. Furthermore, the edge attribute can specify the bond energy for each bond. For example, since the bond energy of a covalently bonded hydrogen molecule is 432 kJ / mol, the edge token can be represented as "covalent bond: 432 kJ / mol".
[0155] Furthermore, if the units are common across all edge attributes, the units may be omitted, and the delimiter between the edge type and edge attribute may be omitted, resulting in the expression "covalent 432". Note that the order of edge types or edge attributes does not matter as long as they are common across the entire dataset, so expressions such as "432 covalent" or "covalent 432 kJ / mol" are also acceptable.
[0156] Furthermore, in a closed dataset, the edge types are limited and all are known. Therefore, even if we specify "432 kJ / mol covalent bond," we can accurately classify the edge type and edge attributes.
[0157] In particular, when selecting a delimiter, it is necessary that it is not included in the string that makes up the node token or edge token. For example, if the node token is "A B" and the delimiter is " ", the node token may be mistakenly split into "A" and "B" in an unintended way. In that case, it can be resolved in the following two ways.
[0158] The first method is to use a character or string that is not included in the node token or edge token as the delimiter. For example, the delimiter could be three consecutive spaces " ".
[0159] Furthermore, when using two or more characters as delimiters, it is necessary to select a string that does not result from combinations of node tokens and node tokens, edge tokens and edge tokens, or node tokens and edge tokens. In particular, delimiters are not used in the learning device for natural language processing within the graph natural language processing device 1. For this reason, it is desirable to use a special string that does not affect computational cost and is sufficiently long when the text to be input during inference is unknown.
[0160] When using a tokenizer that handles half-width spaces as a tokenizer for natural language processing, a second approach is to replace half-width spaces in node tokens or edge tokens with other characters, or to remove half-width spaces altogether. For example, the node token "A B" can be replaced with "AB" or "A_B".
[0161] Node tokens and edge tokens will be explained using the specific example in Figure 9. Figure 9 is a simple graph composed of four nodes and four edges. A simple graph is a graph in which there are zero or only one edge between any two nodes, that is, no two or more edges between any two nodes, and no self-loops where an edge is formed from one node to the same node.
[0162] The graph in Figure 9 has a node with node type A and node attribute 1000, a node with node type B and node attribute 1, a node with node type B and node attribute 10, a node with node type C and node attribute 100, an edge with edge type e and edge attribute 1, an edge with edge type e and edge attribute 10, an edge with edge type f and edge attribute 1, and an edge with edge type f and edge attribute 1.
[0163] For these nodes and edges, node tokens are formed by combining node types and node attributes, and edge tokens are formed by combining edge types and edge attributes. Specifically, by defining a colon ":" as the delimiter between node types and node attributes, node tokens can be represented as "A:1000", "B:1", "B:10", and "C:100". Similarly, by defining a colon ":" as the delimiter between edge types and edge attributes, edge tokens can be represented as "e:1", "e:10", "f:1", and "f:1".
[0164] In this case, node types and edge types do not contain numbers, and node attributes or edge attributes consist only of numbers. Therefore, it is not necessary to use delimiters, but for clarity, delimiters will be used in the following explanation. The node tokens "B:1" and "B:10" are connected to the edge token "e:10", and the node tokens "B:10" and "C:100" are connected to the edge token "f:1", and the node tokens "A:1000" and "C:100" are connected to the edge token "f:1".
[0165] As a result, when the delimiter separating node tokens and edge tokens, and edge tokens and edge tokens are half-width spaces, the following text is created by the processing unit 13 in the node center representation: A: 1000 f: 1 f: 1 B: 1 e: 1 B: 10 e: 1 e: 10 f: 1 C: 100 e: 10 f: 1
[0166] It is preferable that the data input to the natural language processing learning device be the single line string shown above. However, in Embodiment 1, for the sake of clarity, node-center representation will be used, with line breaks so that the node of interest becomes the first word. A: 1000 f: 1 f: 1 B: 1 e: 1 B: 10 e: 1 e: 10 f: 1 C: 100 e: 10 f: 1
[0167] Even if there are two types of tokens, such as the half-width space delimiter " " and the delimiter "¥n", these delimiters themselves do not contain any information. For this reason, it is possible to use two or more delimiters simultaneously by adding special processing, such as making the tokenizer recognize two types of delimiters. However, this may lead to an unnecessary increase in computational cost, so it is preferable to use only one type of delimiter when performing natural language processing. For example, replacing "¥n" with " " can reduce the number of delimiters to one.
[0168] Half-width spaces or delimiters that replace half-width spaces are not included in the tokens generated by the learning unit within the natural language processing tokenizer, which separates the text into node tokens and edge tokens. Therefore, when converting the generated tokens back into node tokens or edge tokens, it is desirable to insert a delimiter for each node token or edge token before converting them back into text or a graph.
[0169] Thus, node-centered representations include 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 strings. As a result, only two types of words are generated in the text, based on node tokens and edge tokens. Consequently, the physical constraints for constructing the graph are preserved, resulting in the special effect that text that can always be converted into a graph can be generated regardless of the order in which the node tokens and edge tokens are generated as text.
[0170] Furthermore, determining whether a generated graph is normal or abnormal requires judgment after the graph is generated, but this judgment cannot be made if the graph is not generated. For this reason, even if the proportion of normal data when converted to a graph is the same, data that does not have physical constraints when converted to a graph can improve the efficiency of generating normal graphs.
[0171] Furthermore, because graphs can be processed using natural language processing, it offers the advantage of not being subject to the constraints that arise when processing graphs with graph neural networks. One of the constraints of graph neural networks is the limited number of nodes that can be generated with realistic time and computational resources; if graphs can be processed using natural language processing, this limitation can be overcome.
[0172] (Edge-centered representation) Edge types are described as a finite number of discrete values that can be classified, and edge attributes are described as continuous or discrete values associated with the edge type. In edge token representation, it was desirable to include node information at both ends of the edge in the edge token, but in edge-centered representation, node information at both ends of the edge is represented as text. Therefore, edge tokens do not necessarily include node information at both ends of the edge. For example, when representing a "molecule" as a graph, the edge type could be set to, for example, a covalent bond, and the edge attribute could be set to the bond energy.
[0173] When representing a "circuit" graphically, edge types can be set to, for example, digital signals and analog signals, and edge attributes can be set to voltage, current, or frequency. Similarly, when representing a "transportation network" graphically, edge types can be set to, for example, ordinary roads and highways, and edge attributes can be set to speed limits. In this case, an edge ID can be set to a unique number assigned to each edge.
[0174] If edge IDs are used as edge names, for example, if the edge name is "covalent bond," then in molecules containing multiple covalent bonds, unity is not guaranteed; that is, when one edge ID is selected, it cannot be assigned to a single edge. This problem can be addressed by changing the edge name of edges that do not maintain unity. However, there is flexibility in how edge names are changed. For example, for two edges with the same name, assigning "_1" to one and "_2" to the other ensures unity, but there is also the flexibility to assign "_2" to one and "_1" to the other. When generating text representing the graph using natural language processing, edges with "_1" are more likely to be generated, resulting in inequality between edges. To eliminate this inequality, it is necessary to create text with the same number of combination changes as permutations by augmenting the data.
[0175] However, if, for example, there are 10 different edges composed of the same string, there are 10 factorial (10!) possible permutations. Therefore, to represent the graph data as text including the 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 process the created text in natural language from the perspective of computational complexity and required memory. For example, it becomes impossible to train the model with realistic computation time and resources.
[0176] Therefore, in the graph natural language processing device 1 according to Embodiment 1, edge tokens are introduced. 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. However, by utilizing the fact that combining edge types and edge attributes improves unity, it can be used as a substitute for edge IDs. That is, if we consider a covalent bond and bond energy as a single edge, and call this edge an edge token, then the edge token has enough unity to serve as a substitute for an edge ID.
[0177] Furthermore, by combining information such as the node order of atoms at both ends of the edge, the sum of the node orders, and the node type, in addition to the binding energy, the unity of edge tokens is improved, making them a substitute for edge IDs. Therefore, graphs can be represented without using edge IDs. However, similar to node tokens, ensuring unity can be difficult with edge tokens alone. Even without unity, edges can be defined by their relative relationships with surrounding nodes, allowing them to be converted to text without losing the characteristics of the graph data. Specifically, a node token is created by combining the edge of interest (the "focus edge") with the node type and node attributes connected to that edge, defining the relative relationships of the edges. This further improves unity and achieves an effect equivalent to edge IDs.
[0178] Conversely, defining a graph based on node ID, node type, node attributes, edge ID, edge type, and edge attributes is a redundant representation. Edges are defined relatively using edge tokens, which combine edge type and edge attributes. This replaces the edge ID.
[0179] In Embodiment 1, when creating an edge token by combining the edge type and edge attributes, a colon ":" is used as a delimiter for clarity. However, if the edge type and edge attributes can be obtained from the edge token, it is not necessary to use a delimiter. These are the same as explained in the node center representation. The best form of the node token and edge token created in this way is shown using a specific example in Figure 7.
[0180] The graph shown in Figure 7 is a simple graph composed of four edges and four edges. A simple graph is a graph in which there are zero or only one edge between any two edges, that is, no two or more edges between any two edges, and no self-loops where an edge leads back to the same edge.
[0181] The graph in Figure 7 shows edges with edge type A and edge attribute 1000, edges with edge type B and edge attribute 1, edges with edge type B and edge attribute 10, edges with edge type C and edge attribute 100, edges with edge type e and edge attribute 1, edges with edge type e and edge attribute 10, edges with edge type f and edge attribute 1, and edges with edge type f and edge attribute 1.
[0182] For these edges, edge tokens are formed by combining the edge type and edge attribute. Specifically, by defining the delimiter between the edge type and edge attribute as a colon ":", the edge tokens can be represented as "A:1000", "B:1", "B:10", and "C:100". Also, by defining the delimiter between the edge type and edge attribute as a colon ":", the edge tokens can be represented as "e:1", "e:10", "f:1", and "f:1".
[0183] In this case, the edge type does not include numbers, and the edge attribute consists only of numbers. Therefore, it is not necessary to use delimiters, but for clarity, delimiters will be used in the following explanation. The node tokens "B:1" and "B:10" are connected to the edge token "e:10", and the node tokens "B:10" and "C:100" are connected to the edge token "f:1", and the node tokens "A:1000" and "C:100" are connected to the edge token "f:1".
[0184] As a result, when the delimiter separating edge tokens, and between edge tokens, is a half-width space, the following text is created by the processing unit 13 in the edge center representation: e:1 B:1 B:10 e:10 B:10 C:100 f:1 B:10 A:1000 f:1 A:1000 C:100
[0185] The data input to the learning device of the natural language processing unit should preferably be a string in the edge-center representation described above. However, in Embodiment 1, for the sake of clarity, the edge-center representation will be used, with line breaks to ensure that the node of interest is the first word. e:1 B:1 B:10 e:10 B:10 C:100 f:1 B:10 A:1000 f:1 A:1000 C:100
[0186] 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, it is desirable to replace newline delimiters with space delimiters before inputting the text into natural language processing.
[0187] The delimiter, which replaces the half-width space, is not included in the tokens generated by the learning unit within the natural language processing, when the text is divided into edge tokens or edge tokens by the tokenizer. Furthermore, the delimiter is not included in the edge tokens or edge tokens generated by a trained learning unit. Therefore, it is desirable to insert a delimiter for each edge token when converting to text or a graph.
[0188] Thus, edge-centered representations include three types of elements: two edge tokens and their delimiters. The delimiters are removed by a tokenizer used in natural language processing to extract words from a string. As a result, only two types of words are generated in the text, based on the two edge tokens. Consequently, the physical constraints for constructing the graph are maintained, and regardless of the order in which the edge tokens are generated as text, it is possible to create text that can be converted into a graph.
[0189] 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, extraction unit 12, and processing unit 13 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 each of the processes shown in Figures 2 to 6. 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 8 and 9.
[0190] Figure 8 is a block diagram showing the hardware configuration for realizing the functions of the graph natural language processing device 1. Figure 9 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 8 and 9, 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 13 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.
[0191] If the processing circuit is a dedicated hardware processing circuit 102 as shown in Figure 8, 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 functions of the graph data acquisition unit 11, the extraction unit 12, and the processing unit 13 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.
[0192] When the processing circuit is the processor 103 shown in Figure 9, the functions of the graph data acquisition unit 11, extraction unit 12, and processing unit 13 of the graph natural language processing device 1 are realized by software, firmware, or a combination of software and firmware. The software or firmware is written as a program and stored in the memory 104.
[0193] The processor 103 realizes the functions of the graph data acquisition unit 11, extraction unit 12, and processing unit 13 of the graph natural language processing device 1 by reading and executing a program stored in the memory 104. 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 each process shown in Figures 2 to 6. These programs cause the computer to execute the procedures or methods of the processes performed by the graph data acquisition unit 11, extraction unit 12, and processing unit 13. The memory 104 may be a computer-readable storage medium that stores a program that causes the computer to function as the graph data acquisition unit 11, extraction unit 12, and processing unit 13.
[0194] 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.
[0195] Some of the functions of the graph data acquisition unit 11, extraction unit 12, and processing unit 13 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 extraction unit 12 and processing unit 13 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.
[0196] 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 constituting a graph network, an extraction unit 12 that extracts nodes containing node information from the graph data, and a processing unit 13 that combines each node information and converts it into node tokens that are processed as one word in natural language processing, and outputs text in which the node tokens are arranged. For example, the processing unit 13 outputs text in which the node token of the node of interest and the node tokens of nodes adjacent to the node of interest are arranged. As a result, the node ID is replaced by the node token, 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 ID sequences that occur when assigning node IDs.
[0197] The graph natural language processing device 1 according to Embodiment 1 includes a graph data acquisition unit 11 that acquires graph data constituting a graph network, an extraction unit 12 that extracts edges including edge information from the graph data, and a processing unit 13 that combines the edge information and converts it into edge tokens that are processed as one word in natural language processing, and outputs text in which the edge tokens are arranged. For example, the processing unit 13 combines the edge information including node information at both ends of the edge and converts it into edge tokens. As a result, the edge ID is replaced by the edge token, so the graph natural language processing device 1 can create text data from graph data without augmenting the data by the number of different order of edge IDs that result from assigning edge IDs.
[0198] In the graph natural language processing device 1 according to Embodiment 1, the processing unit 13 outputs text that has a reversible transformation relationship with graph data for at least the number of nodes and the number of edges. As a result, node IDs are not required, and therefore data augmentation to resolve inequalities in node IDs is not necessary. Furthermore, by unifying the node type and node attribute, graphs that do not satisfy the physical constraints for constructing the graph are not generated, and graph generation efficiency is improved. For example, if a node attribute representing a capacitance of 10 pF is assigned to the ground node of a circuit, an unnecessary node attribute is assigned to the node type, resulting in a graph that does not satisfy the physical constraints. Also, for example, if a node representing a coil of a circuit is assigned a resistance value of 100 Ω and an inductance value of 1 μH, two or more node attributes are assigned during graph generation, which also results in a graph that does not satisfy the physical constraints. The graph natural language processing device 1 can suppress the generation of these graphs.
[0199] In the graph natural language processing device 1 according to Embodiment 1, the processing unit 13 outputs text that has a reversible transformation relationship with graph data for at least the number of nodes and the number of edges. As a result, edge IDs are not required, and therefore data augmentation to resolve inequalities in edge IDs is not necessary. Furthermore, by unifying the edge type and edge attributes, graphs that do not satisfy the physical constraints for constructing the graph are not generated, and graph generation efficiency is improved.
[0200] In the graph natural language processing device 1 according to Embodiment 1, the extraction unit 12 extracts edges containing edge information from graph data, and the processing unit 13 converts the edge information into edge tokens that combine into a single word, and outputs text that arranges node tokens and edge tokens which are processed as different words in natural language processing. As a result, node IDs and edge IDs are not required, and therefore data augmentation to eliminate inequalities in the assignment of node IDs or edge IDs is not required. Furthermore, by unifying node types and node attributes and edge types and edge attributes, graphs that do not satisfy physical constraints are not generated, and the efficiency of graph generation by natural language processing is improved.
[0201] In the graph natural language processing device 1 according to Embodiment 1, node information includes at least one of the following: node type, node attribute, node degree, or edge information of the connected edge. This makes it possible to convert general graph data into a string without node IDs.
[0202] In the graph natural language processing device 1 according to Embodiment 1, the edge information includes at least one of the edge type, edge attributes, or node information of the connected node. This makes it possible to convert general graph data into a string without edge IDs.
[0203] In the graph natural language processing device 1 according to Embodiment 1, the processing unit 13 outputs text containing the same node token two or more times for one or more node tokens in graph data having one or more graph networks. This increases the degree of freedom of graph representation in natural language processing.
[0204] In the graph natural language processing device 1 according to Embodiment 1, the processing unit 13 outputs text containing the same edge token two or more times for one or more edge tokens in graph data having one or more graph networks. This increases the degree of freedom of graph representation in natural language processing.
[0205] In the graph natural language processing device 1 according to Embodiment 1, the processing unit 13 outputs text containing different node tokens for one or more node tokens in graph data having one or more graph networks. This increases the degree of freedom of graph representation in natural language processing.
[0206] In the graph natural language processing device 1 according to Embodiment 1, the processing unit 13 outputs text containing different edge tokens for one or more edge tokens in graph data having one or more graph networks. This increases the degree of freedom of graph representation in natural language processing.
[0207] In the graph natural language processing device 1 according to Embodiment 1, the processing unit 13 replaces a first delimiter in a node token with a first character that is not included in part of the node token, and outputs text arranged with the node tokens separated by the first delimiter. This allows the tokenizer in natural language processing to freely select characters or strings that serve as markers when dividing the text into words.
[0208] In the graph natural language processing device 1 according to Embodiment 1, the processing unit 13 replaces a first delimiter in an edge token with a first character that is not included in part of the edge token, and outputs text arranged with the edge tokens separated by the first delimiter. As a result, a tokenizer in natural language processing can divide the text into words using the first delimiter as a marker.
[0209] In the graph natural language processing device 1 according to Embodiment 1, the processing unit 13 replaces the first delimiter in a node token with a first character that is not included in part of the node token and is not included in part of the edge token, replaces the first delimiter in an edge token with the first character, and outputs text that is separated between node tokens, between edge tokens, and between node tokens and edge tokens by the first delimiter. This allows the tokenizer in natural language processing to freely select characters or strings that serve as markers when dividing text into words.
[0210] In the graph natural language processing device 1 according to Embodiment 1, the first delimiter is a half-width space or two or more characters containing a half-width space. This allows for the inclusion of a half-width space as a delimiter, which facilitates integration with natural language processing.
[0211] In the graph natural language processing device 1 according to Embodiment 1, the processing unit 13 outputs text in which the node token of the node of interest and the node tokens of nodes adjacent to the node of interest in the graph network are arranged using a second delimiter that is not included in part of the node tokens. The second delimiter is effective in distinguishing the node tokens of the node of interest and adjacent nodes. Furthermore, even when using the second delimiter, the graph can be represented by a two-element token composed of a node token and the second delimiter, so that text generated by natural language processing can be converted into a graph.
[0212] In the graph natural language processing device 1 according to Embodiment 1, the processing unit 13 outputs text that is separated and arranged using the first delimiter, with a second delimiter different from the first delimiter, between node tokens, and between node tokens and the second delimiter. This allows the tokenizer in natural language processing to divide the text into words using the first delimiter as a marker.
[0213] In the graph natural language processing device 1 according to Embodiment 1, the processing unit 13 outputs text that arranges node information at both ends of an edge, a third delimiter not included in part of the node token formed by combining the node information, and an edge token that is a combination of the node token and the third delimiter. As a result, in the edge token, the node information of the node connected to one end of the edge is included to the left of the third delimiter, and the node information of the node connected to the other end is included to the right, so that the graph can be represented by the edge token. Node information of the nodes connected to both ends of an edge can be extracted from the edge token generated by natural language processing without processing errors.
[0214] In the graph natural language processing device 1 according to Embodiment 1, the third delimiter does not include the first delimiter. This prevents the tokenizer, which divides text into words by focusing only on the first delimiter, from focusing on the third delimiter.
[0215] In the graph natural language processing device 1 according to Embodiment 1, the processing unit 13 outputs text consisting of node tokens of the node of interest and edge tokens of the edges connected to the node of interest. This allows the graph to be represented in text by sequentially treating all nodes included in the graph as nodes of interest and arranging the edges connected to the nodes of interest. Furthermore, since the graph can be represented using only two-element tokens, node tokens and edge tokens, all text obtained through natural language processing can be converted into a graph.
[0216] In the graph natural language processing device 1 according to Embodiment 1, the processing unit 13 outputs text that arranges the edge token of the edge of interest in the graph network and the node tokens of the nodes connected to both ends of the edge of interest. As a result, all edges included in the graph are sequentially treated as edges of interest, and the nodes connected to the edges of interest are arranged, allowing the graph to be represented as text. Furthermore, since the graph can be represented using only two types of tokens, node tokens and edge tokens, all text obtained through natural language processing can be converted into a graph.
[0217] In the graph natural language processing device 1 according to Embodiment 1, the processing unit 13 outputs text containing node tokens that are represented by the same string more than once for at least one node token by rounding the numerical values of node attributes, aggregating node types, deleting numerical or type information, or augmenting data. This makes it possible to adjust the number of node tokens represented by the same string.
[0218] In the graph natural language processing device 1 according to Embodiment 1, the processing unit 13 outputs text containing edge tokens that are represented by the same string more than once for at least one edge token by rounding the numerical values of edge attributes, aggregating edge types, deleting numerical information or type information, or augmenting data. This makes it possible to adjust the number of edge tokens represented by the same string.
[0219] In the graph natural language processing device 1 according to Embodiment 1, the processing unit 13 changes node tokens represented by the same string that are connected to edge tokens represented by at least the same string, to node tokens with different node information, by adjusting the node order, the distance from one or more selected nodes selected from the graph network, or by adding edge information. This makes it possible to adjust the number of node tokens represented by the same string.
[0220] In the graph natural language processing device 1 according to Embodiment 1, the processing unit 13 changes at least one edge token, which is represented by the same string and connected to a node token, which is represented by the same string and connected to both ends of the edge, to an edge token with different edge information, by adding statistical values including the sum, maximum, or average of the node degrees of the nodes connected to both ends of the edge, the distance from one or more selected nodes selected from the graph network, or node information of the nodes connected to both ends of the edge. This makes it possible to adjust the number of edge tokens represented by the same string.
[0221] In the graph natural language processing device 1 according to Embodiment 1, the processing unit 13 connects different edge tokens, each composed of the same string, to different node tokens, each composed of the same string. This allows a complete text to be created from a single graph using node tokens and edge tokens, eliminating the need to train exponentially augmented text and enabling the graph network to be trained or inferred as a natural language processing method.
[0222] The graph natural language processing method according to Embodiment 1 includes the steps of: Step ST1 in which a graph data acquisition unit 11 acquires graph data constituting a graph network; Step ST2 in which an extraction unit 12 extracts nodes containing node information from the graph data; and Step ST3 in which a processing unit 13 combines each node information and converts it into node tokens that are processed as one word in natural language processing, and outputs text in which the node tokens are arranged. For example, the processing unit 13 outputs text in which the node token of the node of interest and the node tokens of nodes adjacent to the node of interest are arranged. As a result, when the graph natural language processing device 1 performs the above method, the node ID is replaced with a node token, so that text data can be created from graph data without increasing the data volume by the number of different node ID sequences that occur when assigning node IDs.
[0223] The graph natural language processing method according to Embodiment 1 includes the steps of: a graph data acquisition unit 11 acquiring graph data constituting a graph network (Step ST1B); an extraction unit 12 extracting edges including edge information from the graph data (Step ST2B); and a processing unit 13 combining the edge information and converting it into edge tokens that are processed as one word in natural language processing, and outputting text consisting of the edge tokens arranged in a sequence (Step ST3B). For example, the processing unit 13 combines edge information including node information at both ends of an edge and converts it into edge tokens. As a result, when the graph natural language processing device 1 performs the above method, the edge ID is replaced by an edge token, so that text data can be created from graph data without increasing the data volume by the number of different order of edge IDs that result from assigning edge IDs.
[0224] A computer executing the program according to Embodiment 1 functions as a graph data acquisition unit 11 that acquires graph data constituting a graph network, an extraction unit 12 that extracts nodes containing node information from the graph data, and a processing unit 13 that combines each node information and converts it into node tokens that are processed as a single word using natural language processing, and outputs text in which the node tokens are arranged. As a result, since node IDs are replaced by node tokens, a computer executing the program according to Embodiment 1 can create text data from graph data without artificially inflating the data by the number of different node ID sequences that result from assigning node IDs.
[0225] A computer executing the program according to Embodiment 1 functions as a graph data acquisition unit 11 that acquires graph data constituting a graph network, an extraction unit 12 that extracts edges containing edge information from the graph data, and a processing unit 13 that combines the edge information and converts it into edge tokens that are processed as a single word using natural language processing, and outputs text in which the edge tokens are arranged. As a result, since the edge IDs are replaced by edge tokens, a computer executing the program according to Embodiment 1 can create text data from graph data without augmenting the data by the number of different order of edge IDs that arise from assigning edge IDs.
[0226] Embodiment 2. The graph natural language processing device according to Embodiment 2 extracts specific nodes from graph data that match pre-set specific conditions and generates text 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.
[0227] Figure 10 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 ST1E). 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. For example, the graph data acquisition unit 11 creates multi-edge nodes with multiple edges and the same number of terminal nodes as the number of multi-edge nodes, and acquires a graph network by changing the edges connected to the multi-edge nodes to connections to the terminal nodes. The graph data acquired by the graph data acquisition unit 11 is output to the extraction unit 12.
[0228] The extraction unit 12 extracts specific nodes from the graph data acquired by the graph data acquisition unit 11 (step ST2E). Here, a specific node is a node that matches a predetermined specific condition. The 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 ST3E).
[0229] (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 or polarized electrolytic capacitors, directional couplers, and transmitting or receiving antennas can be treated as nodes with directionality in terms of rectification or polarity. Furthermore, when representing a DC power supply as a node, the direction of current flow can be assigned to the edge.
[0230] Furthermore, nodes connected to two or more edges may be extracted as specific nodes. For example, when semiconductors are represented as nodes, the graph natural language processing device 1 is pre-configured with the semiconductor's spec sheet information. The 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. However, it is also desirable to designate all nodes connected to two or more edges as specific nodes, or to designate only nodes that meet specific conditions defined by the user as specific nodes. For example, semiconductors with four or more terminals may be designated as specific nodes, while transistors, which have three terminals, may not be designated as specific nodes. Also, even with the same semiconductor, it is desirable to designate only semiconductors that process high-speed signals, such as CPUs, as specific nodes, while power supply semiconductors are not. Designating nodes as specific nodes allows for the retention of terminal information, thus preventing information degradation when converting from a circuit to a graph. However, this also increases the computational load. In contrast, designating only selected nodes as specific nodes can suppress the increase in computational load. In this case, information degradation occurs, but in many cases there are multiple candidate alternatives for transistors or power supply semiconductors, so it is not necessary to select a specific semiconductor, and it is possible to select a candidate with less information degradation without designating it as a specific node.
[0231] If a specific node exists in the graph (step ST3E; YES), the processing unit 13 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 extraction unit 12 (step ST4E). For example, if the specific node is a node connected to an edge associated with each of the multiple pieces of information, the processing unit 13 creates multiple new nodes corresponding to each piece of information.
[0232] The processing unit 13 connects edges to multiple new nodes (step ST5E). For example, the processing unit 13 connects the edges that were previously connected to a specific node to each of the newly created nodes. Alternatively, the processing unit 13 may create new edges to connect the new nodes together and use these edges to connect multiple new nodes. For example, the processing unit 13 creates a new edge and connects the node that was previously connected to a specific node to one of the multiple new nodes created via the edge.
[0233] A specific node is defined as a node that possesses multiple pieces of information, including first information and second information, and is connected to multiple edges, including a first edge associated with the first information and a second edge associated with the second information.
[0234] The processing unit 13 creates a plurality of 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.
[0235] Next, the processing unit 13 deletes unnecessary edges (step ST6E). For example, the processing unit 13 deletes edges that have become unnecessary due to the creation of multiple nodes. Specifically, the processing unit 13 deletes edges that are connected to a particular node.
[0236] Next, the processing unit 13 deletes the specific node (step ST7E). As a result, the original graph data is transformed into new graph data in which the specific node is replaced by a subgraph having multiple new nodes and new edges connecting these new nodes to each other.
[0237] If the processing up to step ST7E is completed, or if there is no specific node in the graph (step ST3E; NO), the extraction unit 12 extracts node information and edge information from the graph data converted by the processing unit 13 and outputs them to the processing unit 13. The processing unit 13 creates node tokens from the node information extracted by the extraction unit 12 (step ST8E). Furthermore, the processing unit 13 creates edge tokens from the edge information extracted by the extraction unit 12 (step ST9E). The processing unit 13 creates text data by arranging the node tokens and edge tokens (step ST10E) and outputs the created text. In addition, in the graph natural language processing device 1 according to Embodiment 2, the edge information of edges connected to nodes having two or more identical node information is different. Furthermore, in a graph network having two or more identical edge tokens, the node tokens of at least one of the nodes connected to both ends of an edge are different.
[0238] Next, the graph data in Embodiment 2 will be described. Figure 11 is a diagram showing an example of a graph network (1) in Embodiment 2, and shows a graph with a multi-terminal node as an example of a specific node. For example, the graph data acquisition unit 11 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 edges connected to the multi-terminal node to connections to each terminal node, and acquires a graph network with the multi-terminal node removed. This creates the graph shown in Figure 11.
[0239] 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 self-loops and the two multi-edges. In other words, the graph data acquisition unit 11 may create self-loop nodes with self-loops and twice the number of terminal nodes as the number of self-loops, and acquire a graph network by changing the connections of both ends of the edges connected to the self-loop nodes to connections to the terminal nodes. The processing unit 13 divides the multi-terminal node into six nodes and connects the edges that are connected to the multi-terminal node to the divided terminal nodes.
[0240] Furthermore, since multi-terminal node 2 also has multiple edges composed of two edges, it is divided into two terminal nodes. This allows the edges to connect to different terminals, so that the terminal information of the edges that connect to each terminal can be retained in each terminal node. In this case, if there are terminals that the edges do not connect to, it is acceptable to divide it into more terminal nodes than the number of edges.
[0241] 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.
[0242] Furthermore, the same applies to edge tokens; since the edges have the same configuration as before the partitioning, it is not always necessary to change the edge tokens. However, if the partitioning provides special information, it is acceptable to assign it as a new edge token. When creating text from a graph partitioned into terminal nodes in this way, it is desirable to represent it using node-center representation to prevent unnecessary data augmentation. However, if the dataset contains at least one node with terminal numbers, such as a semiconductor, there is only one way to assign node IDs, and data augmentation is unnecessary, so it is also desirable to represent it using edge-center representation.
[0243] By dividing multi-terminal nodes in this way, any graph can be transformed into a simple graph without self-loops or multiple edges. This simple graph has the special effect of being convertible to text without losing any graph information. However, because the above method divides the node into the same number of nodes as the number of edges, or more, it may result in excessive division depending on the dataset. For example, a multi-terminal node with only one self-loop or one multiple edge out of 100 terminals would result in excessive division.
[0244] Figure 12 shows an example (2) of a graph network in Embodiment 2. The graph shown in Figure 12 is a simple graph, obtained by transforming a node with multiple edges into a graph in which only the nodes related to the multiple edges are divided into terminal nodes and the divided nodes are connected by a single edge. The graph data acquisition unit 11 acquires a graph network in this simple graph form. In the graph shown in Figure 12, there is no need to divide the nodes connected to node 1 and node 2. The graph data acquisition unit 11 changes the left diagram of Figure 12 to the right diagram. For example, in the left diagram of Figure 12, the number of terminal nodes is equal to the number of edges connected to a multi-terminal node that has connections to three or more edges, and the ends of the multiple edges connected to the multi-terminal node are changed to connections from the multi-terminal node to the terminal node. That is, the graph data acquisition unit 11 may create the same number of terminal nodes as the number of edges for a multi-terminal node connected to three or more edges, change the edges connected to the multi-terminal node to connections to each terminal node, and acquire a graph network with the multi-terminal node deleted. In this way, as shown in the right-hand figure of Figure 12, a simple graph can be created from a graph with multiple edges while minimizing the increase in terminal nodes.
[0245] Figure 13 shows an example (3) of a graph network in Embodiment 2, and as an example of a specific node, it shows a graph with a multi-terminal node that has a self-loop. In the left diagram of Figure 13, one self-loop is connected to a node with one multi-edge with two edges and two nodes with one edge. The processing unit 13 newly creates twice the number of terminal nodes as the self-loop and connects the edges representing the self-loop that are connected to the self-loop node to the newly created terminal nodes. In this way, as shown in the right diagram of Figure 13, the increase in terminal nodes can be minimized, and the graph with a self-loop can be made into a simple graph.
[0246] Figure 14 shows an example (4) of a graph network in Embodiment 2. For example, when the graph natural language processing device 1 acquires the graph data shown in Figure 7, it extracts nodes from the acquired graph data that are connected to three or more edges as specific nodes. In this case, the node with node type B and node attribute 10 in Figure 7 becomes the specific node. Since this specific node is connected by three edges, the processing unit 13 creates three new nodes corresponding to each piece of information. These node types are common, and the same node types as before the splitting may be assigned.
[0247] Furthermore, you may change the node type using domain knowledge. Node attributes can be added, deleted, or modified based on domain knowledge, but if you lack domain knowledge, you may assign the same node attributes as before the split.
[0248] Furthermore, additional elements such as node numbers or substitutes for the numbers may be added to the divided nodes. Divided nodes can be defined as node tokens in combination with adjacent nodes, just like other nodes, without adding any elements. On the other hand, in Embodiment 2, for clarity, we will explain the case where numbers are assigned to the divided nodes. Specifically, when the node token of a particular node is "B:10", the new node tokens of the terminal nodes can be set to "B:10_1", "B:10_2", and "B:10_3", thereby maintaining that they are different information.
[0249] Alternatively, the node attribute may be split into two elements, such as “B: [10, 1]”, “B: [10, 2]”, and “B: [10, 3]”. In this case, the unsplit node token may be combined to match the number of elements, for example, “A: 1000” to “A: [1000, None]”.
[0250] However, in graph neural networks, which are one type of neural network capable of processing conventional graph data, the number of elements is always the same. In graph natural language processing, however, each element only needs to represent a single token. Therefore, if nodes with the same node information are treated as node tokens with the same string, and edges with the same edge information are treated as edge tokens with the same string, the number of elements and how they are represented can be freely determined.
[0251] In Embodiment 2, the notations "B: 10_1", "B: 10_2", and "B: 10_3" will be used for explanation. It is desirable to assign the node numbers to be added according to certain conditions, such as the lexicographical order of adjacent node tokens. In this case, as shown in Figure 14, "_1" is added to the partition node adjacent to node token "A: 1000", "_2" is added to the partition node adjacent to node token "B: 1", and "_3" is added to the partition node adjacent to node token "C: 100".
[0252] When assigning IDs to nodes in this way, there is a degree of flexibility in how the IDs are assigned, so it is desirable to augment the data by that degree of flexibility. However, if the terminal numbers of the nodes are defined, it is desirable to assign node numbers in order of terminal numbers. In this case, since the numbers are derived from the nodes, no inequality occurs, and thus data augmentation becomes unnecessary.
[0253] For example, when considering a circuit, a semiconductor can be thought of as a node that holds multiple pieces of information. In semiconductors, the terminal number is clear from the manufacturer's published datasheet, so the terminal number can be used as the node number and assigned to the node attribute. The edges that were connected to a specific node are then connected to the newly created node.
[0254] Specifically, node token "A:1000" and node token "B:10_1" are connected at the edge, node token "B:1" and node token "B:10_2" are connected at the edge, and node token "C:100" and node token "B:10_3" are connected at the edge. As a result, in Figure 14, the node tokens are "A:1000", "B:1", "B:10_1", "B:10_2", "B:10_3", and "C:100", and the edge tokens are "B:10_2-B:1" and "B:10_1-A:1000". Thus, the text represented by node tokens is as follows. A:1000:::B:10_1 C:100 B:1:::B:10_2 B:10_1:::A:1000 B:10_2:::B:1 B:10_3:::C:100 C:100:::B:10_3
[0255] The text represented by edge tokens is as follows: B:10_2-B:1 B:10_1-A:1000 B:10_3-C:100 C:100-A:1000
[0256] The text represented by the edge center will look 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
[0257] Furthermore, the node-centered text is as follows: 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
[0258] However, in node-center representation, if the edge tokens connected to the divided node tokens are different, the divided node tokens can be defined in relation to the edge tokens, so there is no need to assign node IDs to the divided nodes. Therefore, "B:10_1", "B:10_2", and "B:10_3" become "B:10", "B:10", and "B:10", respectively.
[0259] In Figure 14, since the edge tokens connected to the divided node tokens are different, there is no need to assign IDs to the divided node tokens, and the node center representation can be expressed 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 IDs 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: 10 C: 100 e: 10 f: 1
[0260] As an example of the graph acquired by the graph natural language processing device 1 according to Embodiment 2, the node token "B:10" shown in Figure 7 represents a company, and the node tokens "A:1000", "B:1", and "C:100" represent users. In this case, in a graph showing that connections are formed between a company and multiple users, the node token "B:10" representing the company is connected to nodes representing multiple users via edges.
[0261] When users are considered stakeholders, they are interested in various aspects of the company represented by the node token "B:10," such as products, profits, or after-sales service. Therefore, by dividing the node token into nodes, each representing a different aspect of the company, and connecting each node to the user at the edge, the information can be stored as a graph tailored to 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. This provides the special effect of preventing information degradation.
[0262] On the other hand, as shown in Figure 7, when a single node is formed to hold multiple pieces of information, the aspects of the node cannot be preserved as graph data. This is reflected in the text (string) created from the graph data, and can be considered information degradation where some of the information from the graph data is lost from the text.
[0263] In Figures 11 to 14, connections between the divided terminal nodes are not necessarily required. If there are no connections, the graph data is insufficient. However, because it is represented as text, the presence of connections is clear from the information obtained from the strings that make up the node tokens and edge tokens. Therefore, there is a special effect that is difficult to achieve with conventional graph neural networks: the ability to reconstruct the original single node from the divided nodes. For example, if a particular divided node has terminals without edge connections, edge-center representation is not possible.
[0264] Figure 15 shows an example (5) of a graph network in Embodiment 2. As shown in Figure 15, this problem is solved by creating a star graph in which the divided nodes are connected by virtual nodes. For example, the graph data acquisition unit 11 provides one virtual node and connects the terminal nodes via the virtual node. In addition, if an edge is connected to a specific node that has been divided from a terminal node, it is also desirable to connect the terminal node and the specific node with a virtual node. For example, the graph data acquisition unit 11 provides one virtual node and, in addition to connecting the terminal nodes, may also connect the terminal nodes to the multi-edge nodes from which the terminal nodes have been separated via the virtual node. Note that the multi-edge nodes from which the terminal nodes have been separated do not have multi-edge nodes, but are nominally treated as multi-edge nodes. The graph data acquisition unit 11 also provides one virtual node and, in addition to connecting the terminal nodes, may also connect the terminal nodes to the self-loop nodes from which the terminal nodes have been separated via the virtual node. Note that the self-loop nodes from which the terminal nodes have been separated do not have self-loops, but are nominally treated as self-loop nodes.
[0265] In Figure 15, the node tokens "B:10_1", "B:10_2", and "B:10_3" are connected to "B:10" via the virtual node indicated by the node token "B:10". Using a virtual node requires the creation of new edge tokens. Tokens not included in other graphs, for example, "edge:1" connects "B:10" and "B:10_1", "edge:2" connects "B:10" and "B:10_2", and "edge:3" connects "B:10" and "B:10_3", indicating that these are edges used for the virtual node.
[0266] Furthermore, by combining the node tokens at both ends of an edge and assigning a single name to the edge token connecting "B:10" and "B:10_1", "B:10" and "B:10_2", and "B:10" and "B:10_3", the edge tokens can be treated as special edges.
[0267] 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, in which the divided terminals are directly connected to each other without using virtual nodes. Also, if an edge is connected to a specific node into which a terminal node has been divided, it is desirable to connect the terminal node and the specific node with an edge to form a complete graph. A complete graph has the advantage of making the relationships between nodes clear because the divided nodes are directly connected, and of reducing the number of nodes because virtual nodes are not used.
[0268] In Figure 15, the node token representation is as follows: ::: A: 1000 B: 10_1 C: 10 ::: B: 1 B: 10_2 ::: C: 100 A: 1000 B: 10_3 ::: B: 10_1 A: 1000 B: 10 ::: B: 10_2 B: 1 B: 10 ::: B: 10_3 C: 100 B: 10 ::: B: 1 B: 10_1 B: 10_2 B: 10_3
[0269] Edge token representations are as follows, for example: B:10_2-B:1 B:10_3-A:1000 B:10_1-C:100 C:100-A:1000 B:10-B:10-1 B:10-B:10-2 B:10-B:10-3
[0270] The node center representation is as follows, for example: 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
[0271] Furthermore, the edge-center representation is as follows, for example: 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
[0272] In this way, by replacing specific nodes with star graphs, terminals without edge connections can also be retained as part of the graph data. Using star graphs makes it possible to add node tokens that are connected only to virtual nodes in the star graph.
[0273] 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 these, "B:10_4" can represent an NC (Non-Connection) terminal. Nodes without edges, such as "B:10_4", like an NC terminal in a semiconductor, are unnecessary and are removed.
[0274] In contrast, by creating virtual nodes and connecting them to nodes representing NC terminals, the existence of NC terminals becomes clear in the form of a graph. The same effect can also be obtained by creating a complete graph by connecting each terminal node with an edge.
[0275] When the number of nodes to be divided is three, the number of edges is the same for both a star graph and a complete graph ("6"). However, as the number of nodes to be divided increases, the star graph increases by the same number as 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, i.e., approximately the square of the number of nodes. For this reason, in a complete graph, for example, if the number of nodes to be divided is 10, 45 edge tokens are required, and if it is 100, 4950 edge tokens are required.
[0276] In graph-based natural language processing, divided nodes do not necessarily have to be connected. Therefore, if the number of nodes is greater than, for example, "5", it is preferable to use a star graph. 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 related to training. However, 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", which is twice the number of edges in a star graph. This means that approximately twice as much text needs to be generated, which increases the computational cost of natural language processing.
[0277] For example, the processing unit 13 may connect edge tokens with different edge information to edges connected to node tokens represented by two or more identical strings. Figure 16 is a diagram showing an example (6) of a graph network in Embodiment 2, and illustrates a method of representing text for data that includes multi-terminal nodes having two or more identical node tokens in one graph. Figure 16 shows how a multi-terminal node having two identical node tokens is divided into nodes for each terminal.
[0278] There are two of each of the node tokens "n:1", "n:2", and "n:3". The two "n:1" tokens are connected to "e:1" and "e:3", the two "n:2" tokens are connected to "e:1" and "e:3", and the two "n:3" tokens are connected to "e:2" and "e:3". By combining node tokens and edge tokens in this way, it is possible to represent two or more identical node tokens without adding node IDs or edge IDs. The processing unit 13 may also assign node IDs to two or more node tokens represented by the same string and augment the data by changing the combination of node IDs. This makes it possible to create text data using graph data obtained with minimal data augmentation.
[0279] Except when connecting identical node tokens, such as when "e:0" connects two "n:3" nodes, it is necessary to assign different edge tokens to divided terminal nodes. For example, if both edge tokens connecting to terminal node "n:1" are "e:1", the connection relationship becomes unclear. Therefore, it is desirable to assign an ID to the edge token, creating "e:1_1" and "e:1_2", and augment the data by adding the ID. However, in many graphs, identical edges are rare, so they can be represented with minimal data augmentation.
[0280] In Figure 16, different edge tokens are attached to two identical node tokens. Therefore, when represented in node center notation, it looks like this: For example, the processing unit 13 connects edge tokens with different edge information to the edge connected to a node token representing a terminal node represented by the same string. If there are two semiconductors of the same type within a single circuit, and each semiconductor is divided into terminal nodes, even if terminal numbers are assigned to the terminal nodes, the node information will be the same. In this case, the node is defined relatively by the edges it connects to, but if the edge tokens are also the same, the node will not be uniquely determined. Therefore, edge tokens with different edge information are connected to the edge connected to the node token representing a terminal node represented by the same string. n:1 e:1 n:2 e:1 n:3 e:2 n:1 e:3 n:2 e:2 n:3 e:3
[0281] Figure 17 shows an example (7) of a graph network in Embodiment 2, illustrating a representation method for edge-center representation. As shown in Figure 17, the processing unit 13 assigns a node ID as a node token to the terminal nodes obtained by dividing a multi-terminal node. In particular, when the terminal number is fixed, this method is superior to node-center representation because it eliminates the need to augment data to resolve inequalities caused by assigning node IDs.
[0282] In Figure 17, since the terminal numbers are not yet determined, we assign "_a" to the node token for the terminal nodes on the left side of Figure 17, and "_b" to the terminal nodes on the right side, resulting in the following representation in edge-center representation: e:1 n:1_a n:2_a e:2 n:3_a n:2_b e:3 n:1_b n_3_b
[0283] In Embodiment 2, we demonstrated the division of a node connected to multiple edges. However, even for a node connected to four edges, such as a carbon atom, if the terminals do not carry information—that is, if it doesn't matter which terminal a hydrogen atom is bonded to and which terminal an oxygen atom is bonded to—it is not necessarily required to divide it. This is because it prevents information degradation when converting from text without terminal information to a graph structure, which represents the molecular structure.
[0284] In cases where there are two or more identical node tokens, attribute information is assigned to the edge tokens so that they become different edge tokens.
[0285] When a single graph data contains two or more semiconductors (or multi-terminal components such as common-mode choke coils) of the same node type and with the same node attributes, the node names of the divided terminals will be common. In such cases, it is preferable to represent them using a node-centered arrangement.
[0286] As described above, in the graph natural language processing device 1 according to Embodiment 2, the graph data acquisition unit 11 creates multi-edge nodes having multiple edges and the same number of terminal nodes as the number of multi-edge nodes, and acquires a graph network by changing the edges connected to the multi-edge nodes to connections to the terminal nodes. This makes it possible to create a graph that does not contain multiple edges.
[0287] In the graph natural language processing device 1 according to Embodiment 2, the graph data acquisition unit 11 creates self-loop nodes having self-loops and terminal nodes twice the number of self-loops, and acquires a graph network by changing the connections of both ends of the edges connected to the self-loop nodes to connections of the terminal nodes. This makes it possible to create a graph that does not contain self-loops.
[0288] In the graph natural language processing device 1 according to Embodiment 2, the graph data acquisition unit 11 creates the same number of terminal nodes as the number of terminals of a multi-terminal node having three or more terminals, changes the edges connected to the multi-terminal nodes to connections to each terminal node, and acquires a graph network with the multi-terminal nodes removed. This makes it possible to create a graph that can retain terminal numbers.
[0289] In the graph natural language processing device 1 according to Embodiment 2, the graph data acquisition unit 11 creates the same number of terminal nodes as the number of edges for a multi-terminal node connected to three or more edges, changes the edges connected to the multi-terminal node to connections to each terminal node, and acquires a graph network with the multi-terminal node removed. This makes it possible to create a simple graph.
[0290] In the graph natural language processing device 1 according to Embodiment 2, the graph data acquisition unit 11 provides a virtual node and connects terminal nodes via the virtual node. This allows terminal nodes to be connected with less computation and memory usage. In the graph natural language processing device 1 according to Embodiment 2, the graph data acquisition unit 11 provides a virtual node and connects terminal nodes, and terminal nodes to multi-edge nodes after their edges have been changed to connections to terminal nodes, via the virtual node. This allows terminal nodes to be connected with less computation and memory usage. In the graph natural language processing device 1 according to Embodiment 2, the graph data acquisition unit 11 provides a virtual node and connects terminal nodes, and terminal nodes to self-loop nodes after their edges have been changed to connections to terminal nodes, via the virtual node. This allows terminal nodes to be connected with less computation and memory usage.
[0291] In the graph natural language processing device 1 according to Embodiment 2, the graph data acquisition unit 11 acquires a graph network as a simple graph. This makes it possible to convert a complete graph, in which all divided terminals are connected, into a simple graph, instead of a star graph with virtual nodes, or to create a simple graph using domain knowledge.
[0292] In the graph natural language processing device 1 according to Embodiment 2, the edge information of the edges connected to nodes having two or more identical node information is different. This makes it possible to create a single graph from text.
[0293] In the graph natural language processing device 1 according to Embodiment 2, in a graph network having two or more identical edge tokens, at least one node token of the nodes connected to both ends of the edge is different. This makes it possible to create only one type of graph from a single text.
[0294] In the graph natural language processing device 1 according to Embodiment 2, the processing unit 13 connects edge tokens with different edge information to edges connected to node tokens represented by two or more identical strings. This makes it possible to create text data that can represent a single graph containing two or more node tokens having the same string without using node IDs.
[0295] In the graph natural language processing device 1 according to Embodiment 2, the processing unit 13 connects edge tokens with different edge information to edges connected to node tokens representing terminal nodes represented by the same string. As a result, even if there are multiple nodes with the same node information, each node can be uniquely identified by the edge token to which it is connected.
[0296] In the graph natural language processing device 1 according to Embodiment 2, the processing unit 13 assigns node IDs to node tokens represented by two or more identical strings and augments the data by changing the combination of node IDs. This makes it possible to create text data using graph data obtained with minimal data augmentation.
[0297] Embodiment 3. The graph natural language processing device 1 according to Embodiment 3 represents oriented edges as text data in either a node-centered representation or an edge-centered representation. 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.
[0298] Figure 18 is a diagram showing an example of a graph network in Embodiment 3, and shows a directed graph with directional edges. Figure 18 has the same node tokens as Figure 7, the difference being that the edges have direction. Note that in Figure 7, the edges do not have direction and can be considered bidirectional, whereas Figure 18 has been extended to handle graphs that only propagate signals in one direction. The differences in Figure 18 from Figure 7 are that the edge from node token "C:100" to "B:10" has direction, and the edge from node token "C:100" to "A:1000" also has direction.
[0299] Furthermore, the edges between the other node tokens "B:10" and "B:1", and the edge between the node token "B:10" and "A:1000", are bidirectional. Since the edges in the undirected graph shown in Figure 7 and the bidirectional edges in the directed graph have the same meaning, these edges have the same meaning in Figure 7 and Figure 18. In this case, in the node-center representation, 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". The results of representing the directed graph in four ways for each of the node token representation, edge token representation, node-center representation, and edge-center representation are shown below.
[0300] (Node Token Representation) Node token representation can be expressed using a combination of a central node of interest and adjacent nodes adjacent to that node. However, by using only the source node as the node of interest, the direction of the edge can be expressed. In Figure 18, "A:1000" is the source of "B:10", "B:1" is the source of "B:10", "B:10" is the source of "B:1" and "A:1000", and "C:100" is the source of "A:1000" and "B:10". Therefore, it can be expressed as follows: A:1000 B:10 B:1 B:10 B:10 B:1 A:1000 C:100 A:1000 B:10
[0301] (Edge Token Representation) Edge token representation can be expressed as a combination of an edge of interest selected from graph data and adjacent nodes adjacent to this edge of interest. In Figure 18, the direction of an edge can be represented by placing the source node token to the left of the third delimiter and the sink node token to the right of the third delimiter. In Figure 18, the relationship between "A:1000" and "B:10" is bidirectional, the relationship between "B:1" and "B:10" is bidirectional, the relationship from "C:100" to "A:1000" is unidirectional, and the relationship from C:100 to B:10 is unidirectional. Therefore, the relationship between the bidirectional "A:1000" and "B:10" can be expressed as "A:1000-B:10" and "B:10-A:1000" by swapping the node tokens before and after the delimiter "-". The bidirectional "B:1" and "B:10" can be represented as "B:1-B:10" and "B:10-B:1" by swapping the node tokens before and after the delimiter "-", resulting in the following edge token representations: A:1000-B:10 B:10-A:1000 C:100-A:1000 C:100-B:10 B:1-B:10 B:10-B:1
[0302] (Node Center Representation) A node center representation can be expressed using a combination of a node token of the central node of interest and edge tokens adjacent to that node of interest. The orientation of an edge can be expressed by assigning the orientation of the edge relative to the node of interest as one of the edge information. In Figure 18, "A:1000" is bidirectional to "B:10" and sinks to "C:100", "B:10" is bidirectional to "A:1000" and sinks to "C:100", "B:1" is bidirectional to "B:1", "B:1" is bidirectional to "B:10", "C:100" is source to "A:1000", and "B:10" is source to "B:10". Therefore, the node center representation is as follows. A: 1000 f: [1, bidirectional] f: [1, sink] B: 10 f: [1, bidirectional] e: [10, sink] e: [1, bidirectional] B: 1 e: [1, bidirectional] C: 100 f: [1, source] e: [10, source]
[0303] In this case, the direction information can be replaced with numbers, for example, with "0" representing bidirectional, "1" representing sink, and "2" representing source, and expressed as follows: A: 1000 f: [1,0] f: [1,1] B: 10 f: [1,0] e: [10,1] e: [1,0] B: 1 e: [1,0] C: 100 f: [1,2] e: [10,2]
[0304] (Edge-centered representation) Edge-centered representation can be represented by a combination of an edge token of a central focus edge and node tokens adjacent to that focus edge. The edge orientation is included in the edge information, and a directional edge can be represented by arranging the node tokens connected to a unidirectional focus edge in the direction from the source node to the sink node. In other words, the processing unit 13 outputs text in which the word nodes of nodes connected to the end of a unidirectional focus edge are arranged in the direction from the source node to the sink node, based on the edge orientation included in the edge information.
[0305] In Figure 18, e:1 between B:1 and B:10 and f:1 between B:10 and A:1000 are bidirectional. Therefore, the order of node tokens connected to the edge of interest is arbitrary; they may be arranged in lexicographical order, or data augmentation may be performed.
[0306] On the other hand, e:1 between C:100 and B:10, and f:1 between C:100 and B:10, are unidirectional. Therefore, in e:1, the source side C:100 is written first, and the sink side B:10 is written second. Similarly, in f:1, the source side C:100 is written first, and the sink side B:10 is written second, resulting in the following strings: e:[1, bidirectional] B:1 B:10 e:[10, unidirectional] C:100 B:10 f:[1, unidirectional] C:100 A:1000 f:[1, bidirectional] B:10 A:1000
[0307] In bidirectional traffic, the order of adjacent nodes can be changed, so for example, it can be expressed as follows: e: [1, bidirectional] B: 10 B: 1 e: [10, unidirectional] C: 100 B: 10 f: [1, unidirectional] C: 100 A: 1000 f: [1, bidirectional] A: 1000 B: 10
[0308] The graph natural language processing device 1 according to Embodiment 3 can represent not only oriented edges but also signed edges. 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 node-center representation, 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]
[0309] Furthermore, in edge-center representation, it can be expressed 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
[0310] As described above, in the graph natural language processing device 1 according to Embodiment 3, only the source node is treated as the node of interest. This makes it possible to represent a directed graph with directional edges using only node tokens.
[0311] In the graph natural language processing device 1 according to Embodiment 3, the processing unit 13 places the node token of the source node to the left of the third delimiter and the node token of the sink node to the right of the third delimiter. This makes it possible to represent a directed graph with directional edges using only edge tokens.
[0312] In the graph natural language processing device 1 according to Embodiment 3, the edge information includes information about the orientation of the edge relative to the node of interest. This makes it possible to represent a directed graph having directional edges by combining node tokens and edge tokens.
[0313] In the graph natural language processing device 1 according to Embodiment 3, the edge information includes the orientation of the edges. Based on the orientation of the edges included in the edge information, the processing unit 13 outputs text in which the word nodes of the nodes connected to the end of the unidirectional edge of interest are arranged in the direction from the source node to the sink node. By combining node tokens and edge tokens, a directed graph having directional edges can be represented.
[0314] Embodiment 4. Embodiments 1 to 3 allow for the free selection of the order of node tokens of adjacent nodes adjacent to the node of interest and the order of node tokens of the node of interest, thus enabling the creation of multiple texts from a single graph. In contrast, the graph natural language processing device according to Embodiment 4 determines the arrangement of edge tokens and node tokens for the entire dataset. 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.
[0315] The node token representation, edge token representation, and node center representation described up to Embodiment 3 all convert a graph into text using at least one of a node token and an edge token. In the node token representation, the order of node tokens of adjacent nodes adjacent to the node of interest and the order of node tokens of the node of interest can be freely selected. This leads to the problem that multiple texts can be created from a single graph. In this case, the order is arbitrary, and if Benford's Law is followed, earlier node tokens are more advantageous in generation than later ones, resulting in inequality based on arbitrariness.
[0316] Furthermore, in edge token representation, the order of node tokens of nodes connected to both ends of an edge to be included in the edge token of the edge of interest, and the order of edge tokens of the edge of interest, can be freely selected. Therefore, if it is necessary to create multiple texts from a single graph, or if only one text is created, an inequality can arise between node tokens or edge tokens depending on the order in which the node tokens or edge tokens are listed, resulting in the generation of biased text. In this case, there is arbitrariness in the order in which they are arranged, and if Benford's Law is followed, an inequality based on arbitrariness arises because earlier node tokens are more advantageous in generation than later ones.
[0317] In node-centered representation, the combination of the node of interest and its adjacent edges results in a string represented by one node token and multiple edge tokens. In edge-centered representation, the combination of the edge of interest and the nodes connected to that edge results in a string represented by one edge token and the node tokens of the nodes connected to both ends of the edge. Therefore, in node-centered representation, there is flexibility in the order of the node of interest and its adjacent edges, and in edge-centered representation, there is flexibility in the order of the edge of interest and its adjacent nodes.
[0318] In Embodiment 1 or Embodiment 2, there is no fixed order for the node of interest, adjacent edges, and the edges of interest and adjacent nodes. Therefore, it was possible to freely rearrange the strings from a single graph, allowing for multiple representations. However, allowing flexibility in representation necessitates augmenting the data to eliminate inequality and represent all possible arrangements. Therefore, similar to converting graph data to text using node IDs or edge IDs, it is necessary to augment the data exponentially with respect to the number of node tokens or edge tokens and input the results into natural language processing.
[0319] This problem can be solved by defining the arrangement of edge tokens or node tokens for the entire dataset. Node token representations consist of combinations of focus nodes and neighboring nodes; edge token representations consist of combinations of focus edges and neighboring edges; node center representations consist of combinations of focus nodes and neighboring edges; and edge center representations consist of combinations of focus edges and neighboring nodes. To avoid repetition, neighboring edges, neighboring nodes, focus edges, and focus nodes will be explained separately. The following explanations will use node center and edge center representations as examples, but the same principles apply to node token representations or edge token representations.
[0320] (Adjacent Edges) There are four main ways to arrange edge tokens. You may use only one of these 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 7 as an example. In Figure 7, 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". In node center representation, it 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
[0321] Furthermore, the node degrees of each node token are as follows: "A: 1000" is "2", "B: 1" is "1", "B: 10" is "3", and "C: 100" is "2". At both ends of the edge corresponding to edge token "f: 1", there are nodes of node token "B: 10" and node token "A: 1000", and the sum of their node degrees is "5". Similarly, the sum of the node degrees of "B: 10" and "A: 1000" for "f: 1" is "5", the sum of the node degrees of "B: 10" and "C: 100" for "e: 10" is "5", the sum of the node degrees of "B: 10" and "B: 1" for "e: 1" is "4", and the sum of the node degrees of "B: 10" and "A: 1000" for "f: 1" is "5". That is, they are arranged in the order f:1 → e:10 → f:1 → e:1. Also, the edge token of the node token of the node of interest "A:1000" is "f:1 f:1", the edge token of the node token of the node of interest "B:10" is "f:1 e:10 e:1", and the edge token of the node token of the node of interest "C:100" is "f:1 e:10". As a result, 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
[0322] This method considers that nodes with higher degrees tend to better represent the overall characteristics of the graph. By summing the node degrees, edges that best represent the overall characteristics of the graph are prioritized. This allows for graph generation based on natural language processing to start with nodes or edges that best represent the graph's characteristics.
[0323] Furthermore, when using a decoder model in natural language processing to infer the entire graph from only a portion of it, the information from that portion of the graph is input first, which aligns with the purpose of actual use, as it prioritizes inputting elements with higher node orders. This is based on the principle that when representing a circuit with a graph network, for example, inputting semiconductors with higher node orders as part of the graph is more effective in representing the circuit's characteristics than inputting capacitors with lower node orders as part of the graph, thus making it easier to generate the desired circuit and resulting in a more natural representation.
[0324] The second method is to sort the nodes connected to both ends of the edge by their maximum node degree. The node degrees are "2" for "A:1000", "1" for "B:1", "3" for "B:10", and "2" for "C:100". Therefore, the maximum node degree for "f:1" of "B:10" and "A:1000" is "3", the maximum node degree for "e:10" of "B:10" and "C:100" is "3", the maximum node degree for "e:1" of "B:10" and "B:1" is "3", and the maximum node degree for "f:1" of "B:10" and "A:1000" is "3", all of which are equal. For this reason, in Figure 7, no sorting is performed, and the string representing the node center 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
[0325] 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, graph generation based on natural language processing can prioritize the generation of areas around nodes that easily represent the overall characteristics of the graph.
[0326] The third method is to sort the edges by distance from the selected node. For example, if “A: 1000” is the selected 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 sorted in the order f: 1 → f: 1 → e: 1 → e: 10. Thus, the node center representation string is as follows: A: 1000 f: 1 f: 1 B: 1 e: 1 B: 10 f: 1 e: 1 e: 10 C: 100 f: 1 e: 10
[0327] This method has the advantage of allowing flexibility in how selected nodes are determined, and can be done using the dataset and domain knowledge. However, if domain knowledge is unavailable, or if the dataset lacks features, it is preferable to select the node token with the higher node degree. This is because, in many datasets, nodes connected to multiple other nodes tend to be nodes that can represent features of the entire graph. Thus, the features of selected nodes, when combined with domain knowledge, can efficiently represent the graph and can be generated from important nodes or edges within the graph.
[0328] Note that while the distance from the selected node was calculated by adding a distance of "1" to each edge, if each edge has a different distance, edge information may be used. Furthermore, nodes may also have distance information. In addition, distance information may be assigned to edges or nodes not only as positive values but also as negative values.
[0329] The fourth method is to arrange edge tokens in order of terminal number for node tokens that have terminal numbers. For example, for a node token "B:10", if 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 the tokens will be arranged in the order of "f:1" between "B:10" and "A:1000" → "e:1" → "e:10" → "f:1" between "A:1000" and "C:100". Therefore, the string representing the node center will be as follows. Unlike the three methods above, this method has the characteristic of being able to generate text that preserves the order of terminal numbers in text generation representing a graph based on natural language processing. A:1000 f:1 f:1 B:1 e:1 B:10 f:1 e:1 e:10 C:100 e:10 f:1
[0330] Edge tokens with the same conditions exist in four ways: by the sum of node degrees, by the maximum node degree, by the distance from the selected node, and by terminal number. In this case, multiple text representations can be conceivable from a single graph, and a massive amount of data is required to train a randomly arranged string.
[0331] Therefore, in order to recognize one text representation per graph, edge tokens that have the same sum of node degrees, the same maximum node degree, the same distance from the selected node, or the same terminal number are sorted alphabetically.
[0332] For example, the sum of the node degrees is as follows: "B:10" and "A:1000" have "f:1" which is "5", "B:10" and "C:100" have "e:10" which is "5", "B:10" and "B:1" have "e:1" which is "4", and "B:10" and "A:1000" have "f:1" which is "5". Since the sum of the node degrees of "f:1", "f:1", and "e:10" are equal, they are arranged lexicographically as "e:10" → "f:1" → "f:1" → "e:1". As a result, the node center representation string is 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
[0333] However, if the lexicographical order is common to all graphs, then arranging them in reverse order is also acceptable. Furthermore, edge tokens can be arranged lexicographically from the beginning without using the four methods described above. 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.
[0334] Furthermore, if there is sufficient computing resources or training time, data augmentation can be achieved by rearranging the order of edge tokens under the same conditions. For example, node center representation augmentation can be achieved by rearranging the order of "B:10" and "C:100", 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
[0335] A:1000 f:1 f:1 B:1 e:1 B:10 e:10 f:1 e:1 C:100 f:1 e:10
[0336] A:1000 f:1 f:1 B:1 e:1 B:10 f:1 e:10 e:1 C:100 e:10 f:1
[0337] A:1000 f:1 f:1 B:1 e:1 B:10 f:1 e:10 e:1 C:100 f:1 e:10
[0338] Furthermore, unlike data augmentation aimed at eliminating inequality, this data augmentation is aimed at improving the textual expressiveness of a single graph. For this reason, it is acceptable to change two or more node tokens or edge tokens simultaneously. In this case, data augmentation in node center representation would look like this, for example: At this time, adjustments such as using only one depending on the available computational resources are also acceptable. A: 1000 f: 1 f: 1 B: 1 e: 1 B: 10 e: 10 f: 1 e: 1 C: 100 e: 10 f: 1
[0339] A:1000 f:1 f:1 B:1 e:1 B:10 f:1 e:10 e:1 C:100 f:1 e:10
[0340] By augmenting the data in this way, it becomes possible to create a dataset that includes how the same node token is represented in other nodes. This has the effect of allowing augmented node information, based on the relationship with edges connected to other nodes that have the same node token, to be passed as data for natural language processing.
[0341] (Edges of Interest) Similar to adjacent edges, there are four main ways to arrange edge tokens: by the maximum node degree, by the distance from the selected node, and by terminal number. We will omit explanations of the parts that are repeated with adjacent edges. 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". The node center representation 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
[0342] The first method is based on the sum of the node degrees at both ends of the edge. The node degrees are "2" for "A:1000", "1" for "B:1", "3" for "B:10", and "2" for "C:100". Therefore, for edge "f:1" connected to the nodes corresponding to "B:10" and "A:1000", the sum of the node degrees is "5", for edge "e:10" connected to the nodes corresponding to "B:10" and "C:100", the sum of the node degrees is "5", for edge "e:1" connected to the nodes corresponding to "B:10" and "B:1", the sum of the node degrees is "4", and for edge "f:1" connected to the nodes corresponding to "B:10" and "A:1000", the sum of the node degrees is "5". In other words, in terms of the sum of the node degrees, 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
[0343] The second method is to sort by the maximum node degree at both ends of the edge (maximum node degree). The node degrees are "2" for "A:1000", "1" for "B:1", "3" for "B:10", and "2" for "C:100". Therefore, for edge "f:1" connected to the nodes corresponding to "B:10" and "A:1000", the maximum node degree is "3", for edge "e:10" connected to the nodes corresponding to "B:10" and "C:100", the maximum node degree is "3", for edge "e:1" connected to the nodes corresponding to "B:10" and "B:1", the maximum node degree is "3", and for edge "f:1" connected to the nodes corresponding to "B:10" and "A:1000", the maximum node degree is "3". Since the maximum node degrees are all the same, 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
[0344] The third method is to sort the edges by distance from the selected node. For example, if “A: 1000” is the selected 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, based on the above distances, the edge tokens are sorted in the order f: 1 → f: 1 → e: 1 → e: 10. As a result, the string of the edge center representation 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
[0345] The fourth method is to arrange edge tokens in order of their terminal numbers for node tokens that have terminal numbers. For example, for a node token with "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". In this case, the order is "f:1" (between "B:10" and "A:1000") → "e:1" → "e:10" → "f:1" (between "A:1000" and "C:100"), so the string of the edge center representation 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
[0346] Similar to the adjacent edges described above, it is a desirable embodiment to arrange edge tokens with the same conditions alphabetically and allow only one text representation from a single graph. For example, the processing unit 13 may add a string of edge tokens with the same conditions rearranged based on at least one of the following: the sum of the node degrees of the nodes connected to both ends of the edge, a statistical value including the maximum or average value, the distance from a selected node selected from the graph network, or the terminal number of the node. It is also desirable to represent a single graph with multiple texts created by rearranging edge tokens with the same conditions, in accordance with computing resources.
[0347] (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.
[0348] The first method is to arrange them in order of node degree. In Figure 7, the node tokens are "A: 1000", "B: 1", "B: 10", and "C: 100", and the edge tokens are "e: 1", "e: 10", "f: 1", and "f: 1". Therefore, the edge center representation 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
[0349] The node degrees are "2" for "A:1000", "1" for "B:1", "3" for "B:10", and "2" for "C:100". Therefore, 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 string of the edge center representation 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
[0350] This method, considering that nodes with higher degrees tend to better represent the overall characteristics of the graph, prioritizes edges that best represent the overall characteristics of the graph by summing the node degrees. This stems from the fact that graph generation prioritizes generating elements that best represent the graph's characteristics.
[0351] The second method is to arrange the nodes in order of distance from the selected node. If "A: 1000" is the selected 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". The string in edge-center representation 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
[0352] The selection of nodes is flexible and can be done using the dataset and domain knowledge. However, if domain knowledge is unavailable or the dataset lacks distinctive features, it is desirable to select node tokens with high node degrees. This is because, in many datasets, nodes connected to multiple other nodes tend to be nodes that represent features of the entire graph. Thus, selecting node features has the effect of efficiently representing the graph using domain knowledge.
[0353] Furthermore, the second method is even more desirable when combined with the aforementioned focus edge, which has the unprecedented effect of being able to create a complete text from a single graph without data augmentation. Thus, the processing unit 13 may add text in which node tokens of the same condition are rearranged based on at least one of the node degree or the distance from the selected node selected from the graph network.
[0354] 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 described above, the node degrees are "A: 1000" is "2", "B: 1" is "1", "B: 10" is "3", and "C: 100" is "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". As a result, the node tokens are arranged in the order "B: 10" → "A: 1000" → "C: 100" → "B: 1". Consequently, the string in edge-center representation 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
[0355] However, if the lexicographical order is common to all graphs, the edges may be arranged in reverse order. Alternatively, the edge tokens may be arranged 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 small, so it is preferable to arrange them in lexicographical order, which requires less computation.
[0356] Furthermore, to enhance the expressiveness of the graph, data augmentation can be performed by rearranging the order of node tokens that have the same node degree or the same distance from the selected node. In the example above, the nodes were arranged in lexicographical order, "A: 1000" → "C: 100", but if data augmentation is performed in the reverse order, "C: 100" → "A: 1000", the resulting string will be as follows. In this case, if there are sufficient computational resources, data augmentation can 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
[0357] f:1 B:10 A:1000 e:10 B:10 C:100 f:1 C:100 A:1000 e:1 B:10 B:1
[0358] (Node of Interest) There are mainly two ways to arrange the node tokens of the node of interest. We will omit the explanation of the adjacent nodes as it would be a repetition of the previous explanation. The first method is to arrange them in order of node degree. In Figure 9, 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 center representation is shown below. e: 1 B: 1 B: 10 e: 10 B: 10 C: 100 f: 1 B: 10 A: 1000 f: 1 A: 1000 C: 100
[0359] The node degrees are as follows: "A: 1000" is "2", "B: 1" is "1", "B: 10" is "3", and "C: 100" is "2". Therefore, when the node tokens are arranged in order of node degree, it becomes "B: 10" → "A: 1000" → "C: 100" → "B: 1". The node center representation string 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
[0360] The second method is to arrange the nodes in order of distance from the selected node. If "A: 1000" is the selected 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". Thus, the string in node center representation 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
[0361] Similar to adjacent nodes, a complete text can be created from a single graph by arranging nodes with the same node degree or distance from the selected node in lexicographical order. Combining this with the adjacent edges mentioned above yields even greater results. 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
[0362] Furthermore, for 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 string is created. Note that the amount of data augmentation may be adjusted to suit the computing environment, and it is also desirable to create text with two or more node tokens changed 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
[0363] B:10 f:1 e:10 e:1 C:100 f:1 e:10 A:1000 f:1 f:1 B:1 e:1
[0364] By determining the order of the target node, adjacent nodes, target edge, and adjacent edge, and combining them, a unique text can be created from a single graph. For example, the processing unit 13 simultaneously fixes the order in which node tokens and edge tokens are arranged. Then, it creates 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. This makes it easier for natural language processing to extract the characteristics of a single graph.
[0365] As described above, in the graph natural language processing device 1 according to Embodiment 4, the processing unit 13 arranges edge tokens based on at least one of the following: the sum of the node degrees of the nodes connected to both ends of the edge, a statistical value including the maximum or average value, the distance from a selected node selected from the graph network, the terminal number of the node, or lexicographical order. This reduces the amount of text that can be created from a single graph.
[0366] In the graph natural language processing device 1 according to Embodiment 4, the processing unit 13 arranges node tokens based on at least one of the node degree, the distance from the selected node selected from the graph network, or lexicographical order. This reduces the amount of text that can be created from a single graph.
[0367] In the graph natural language processing device 1 according to Embodiment 4, the processing unit 13 adds a string of edge tokens sorted under the same conditions based on at least one of the following: the sum of the node degrees of the nodes connected to both ends of the edge, a statistical value including the maximum or average value, the distance from a selected node selected from the graph network, or the terminal number of the node. This improves the expressiveness of a single graph.
[0368] In the graph natural language processing device 1 according to Embodiment 4, the processing unit 13 adds text in which node tokens of the same condition are rearranged based on at least one of the node degree or the distance from a selected node selected from the graph network. This improves the expressiveness of a single graph.
[0369] In the graph natural language processing device 1 according to Embodiment 4, the processing unit 13 simultaneously fixes the order in which node tokens are arranged and the order in which edge tokens are arranged. This makes it possible to create a complete text from a single graph using node tokens and edge tokens.
[0370] Embodiment 5. Embodiment 4 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 formed by combining the node type and node attributes, no elements other than the combined node attributes appear for each node type.
[0371] Therefore, the graph natural language processing device according to Embodiment 5 augments data by increasing the number of node tokens or edge tokens by changing the attribute information of node tokens and edge tokens. The graph natural language processing device according to Embodiment 5 has the same components as the graph natural language processing device 1 shown in Figure 1, but the functions of each component are different as will be described later. The configuration of the graph natural language processing device according to Embodiment 5 will be described below with reference to Figure 1.
[0372] Graph data is less numerous than images or natural language data, and it is desirable to extract many features from a single graph data set. Therefore, Embodiment 4 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 formed by combining node types and node attributes, no elements other than the combined node attributes appear for each node type. Similarly, since edge tokens are created by combining edge types and edge attributes, no elements other than the combined edge attributes appear for each edge type.
[0373] Therefore, we will augment the data by increasing the number of node tokens or edge tokens by changing the attribute information of the node tokens or edge tokens. In other words, we will describe a method to increase the number of features that can be extracted from graph data by relaxing the overly restrictive conditions by using node tokens or edge tokens and increasing the number of node tokens or edge tokens.
[0374] (Data augmentation based on node token attributes) A drawback of using node tokens, which combine node information into a single word, is that natural language processing generates elements that can be node attributes for a given node type. As a result, combinations of node types and node attributes that are not included in the node token may not appear. For example, if you separately learn 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 to generate a node with the node type being a car and the node attribute being 70 km / h. However, because the node token is narrowed down to car: 50 km / h and train: 70 km / h, a node with car: 70 km / h will not be generated.
[0375] This reduces the degrees of freedom during generation based on natural language processing. Therefore, the aim is to improve the degrees of freedom of graph representation that have been reduced by node tokens. In the example above, 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. In other words, there is a method of augmenting data by using node tokens with modified node attributes. For example, the string of the node center based on Figure 7 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
[0376] For example, if node token "A:1000" can take on a different node attribute "A:100", then by replacing "A:1000" with "A:100", a new graph can be created, and new text can be generated based on this graph. By adding this text to the training data for natural language processing, the degrees of freedom during natural language processing generation increase, making it easier to generate normal graphs that are not included in the dataset. Furthermore, unlike the data augmentation up to Embodiment 4, the text in Embodiment 5 is a data augmentation that represents a different graph. In node center representation, it would look like this: B:10 f:1 e:10 e:1 A:100 f:1 f:1 C:100 f:1 e:10 B:1 e:1
[0377] 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 node-centered representation text for the graph: B:10 f:1 e:10 e:1 A:100 f:1 f:1 C:100 f:1 e:10 B:3 e:1
[0378] This new text 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, this text augmentation is intended to improve the expressiveness of the graph. Therefore, it is not necessary to augment the data for all possible combinations, and data augmentation can be freely determined based on factors such as computational resources and computation time. For example, a string may be created in which two or more node tokens, two or more edge tokens, or one or more node tokens and one or more edge tokens are changed simultaneously.
[0379] However, changing node attributes requires domain knowledge, and the attributes must be appropriate for the node type and the characteristics of the graph. For example, if the node type is a car and the node attribute is average speed, the average speed when driving on a regular 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 will differ between a graph representing a regular road and a graph representing high speed.
[0380] Therefore, it is necessary to change the node attributes to match the characteristics of the graph. To achieve this, we use nodes of the same type but with different attributes within the same graph. Node tokens "B:1" and "B:10" are examples of nodes of the same type but with different attributes. In this case, the text with "B:1" replaced by "B:10" would look like this: B:10 f:1 e:10 e:1 A:100 f:1 f:1 C:100 f:1 e:10 B:10 e:1
[0381] The text with "B:10" replaced by "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
[0382] The text obtained by replacing "B:1" with "B:10" and "B:10" with "B:1" is as follows. This allows for data augmentation by creating 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
[0383] Furthermore, it is also desirable to extract nodes that are already included in the graph data, have the same node type and node degree, but have different node attributes, and then augment the data using those different node attributes. In other words, the processing unit 13 augments the data for sets of nodes that are the same node type but have different node attributes by swapping or duplicating node tokens between sets of nodes.
[0384] With this method, for example, in a dataset representing highways, a node for a congested car has a node degree of "4" because there are cars in front, behind, and to the sides. A node for a car that is not congested has a node degree of "1" or "2" because there are cars in front and behind, or cars are sparsely distributed in front and behind. Therefore, similar node attributes can be extracted depending on the environment, and these different node attributes can be used to augment the data. This method does not require domain knowledge and has the unprecedented effect of significantly reducing the creation of abnormal node tokens.
[0385] The above explanation described a node-center representation with a node of interest, but it is desirable to similarly augment data for node tokens in node token representations or edge-center representations. Furthermore, data augmentation can be performed not only by using node attributes of similar or identical nodes, but also based on adjacent edge information or adjacent node information, in addition to nodes of the same type and node degree. However, forming node tokens solely by swapping node attributes in this way has the drawback that combinations of node types and node attributes cannot be freely generated.
[0386] Therefore, we will show a method for changing node attributes for node types. For example, if we consider a graph representing a transportation network using domain knowledge, and assume that cars travel between 30 km / h and 120 km / h, we can create node tokens with different values, such as car: 30 km / h and car: 50 km / h, not just 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, we can improve the flexibility of expression in natural language processing.
[0387] Furthermore, if sufficient graph data is available, data augmentation can be performed by changing node tokens to attribute values of nodes of the same type but with different node attributes. For example, if there is a car: 48 km / h in one graph or another, 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, haphazardly changing node attributes without domain knowledge may result in generating text that represents an abnormal graph.
[0388] 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 type but also of the same degree and have different node attributes. This reduces the possibility of abnormal graphs. Furthermore, instead of making changes, it is also desirable to create a set of nodes that are of the same type and the same degree but have different node attributes, and to exchange node attributes within the set of nodes, or to duplicate (copy) one node attribute to another node. In other words, the processing unit 13 augments the data for a set of nodes that are of the same type, the same degree, and have different node attributes by exchanging node attributes between the sets of nodes or by using duplicated node tokens. This takes advantage of the fact that a set of nodes is more likely to have similar information than randomly selected nodes, and that changes between such sets of nodes are less likely to create abnormal data.
[0389] Furthermore, if sufficient text is available, it is desirable to augment the data by utilizing domain knowledge and employing attribute values of nodes that meet specific conditions based on adjacent node types or node attributes. In this case, 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.
[0390] For example, if there are 100 node attributes for nodes of the same node type, and a bar graph with the difference from the mean of the 100 attribute values on the horizontal axis and the number on the vertical axis follows a normal distribution, then it is desirable to create node attributes that follow a normal distribution and augment the data with text that has those node attributes. It is desirable to create a set of nodes that are not only of the same node type, but also of the same node degree and edge information connected to the nodes, or similar enough to be considered the same set, and then use the statistical values of that set of nodes to assign new node attributes, as this is less likely to generate abnormal data.
[0391] Data augmentation, also known as "data extension," is a method to prevent overfitting by creating multiple data sets from a single set, for example, by performing rotation or stretching (affine transformation) or partial extraction on image data. In natural language processing, data augmentation can also be achieved by replacing words with synonyms or rearranging their order.
[0392] In Embodiment 5, in addition to preventing overfitting, the creation of node tokens is effective in improving the expressiveness of a single graph. Furthermore, it also has the effect of augmenting the data by a computably feasible amount.
[0393] (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 for an edge type are generated by natural language processing. As a result, 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.
[0394] Therefore, the aim is to improve the degree of freedom in graph representation that has been reduced by edge tokens. As a first step, there is a method of augmenting data with edge tokens whose edge attributes have been changed. For example, the string of the edge center based on Figure 7 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
[0395] For example, considering a node attribute "e:100" that is different from the edge token "e:10", we can create the following new text by replacing "e:10" with "e:100". f:1 B:10 A:1000 e:100 B:10 C:100 f:1 A:1000 C:100 e:1 B:10 B:1
[0396] Thus, unlike the data augmentation to eliminate inequality caused by the assignment of edge IDs as described in Embodiment 1, this data augmentation is for improving the expressiveness of the graph, so it is acceptable to create a string by simultaneously changing two or more edge tokens.
[0397] Furthermore, while data augmentation aimed at eliminating inequality generates text that represents the same graph, the data augmentation in Embodiment 3 differs in that it creates text that represents different graphs.
[0398] Furthermore, it is desirable to combine this with the data augmentation of the node tokens mentioned above, which can improve the expressiveness of a single graph and make it easier to capture the features of the graph or multiple graphs using natural language processing. As a result, generation accuracy improves, or it becomes possible to generate unprecedented graphs using natural language processing. However, modifying edge attributes requires domain knowledge, and it is necessary to make changes that are appropriate for the edge type and that are in line with the characteristics of the graph.
[0399] Therefore, for nodes in the same graph with the same edge type but different edge attributes, data augmentation is performed by changing the edge attributes to different edge tokens. In the example above, node tokens "e:1" and "e:10" are edges with the same edge type but different edge attributes. In this case, the text created by changing "e:1" to "e:10" and "e:10" to "e:1" can be augmented as new text like the following: f:1 B:10 A:1000 e:1 B:10 C:100 f:1 A:1000 C:100 e:10 B:10 B:1
[0400] Unlike nodes, edges can obtain information about the nodes at both ends. Therefore, it is desirable to augment the data using only edges that are of the same type, have the same node types at both ends, and have different edge attributes. Furthermore, data augmentation may also be performed using only edges that share common node degree or node attributes at both ends.
[0401] Furthermore, instead of making changes when augmenting data, it is desirable to create edge sets where the edge types are the same, the node types at both ends of the edge are the same, and the edge attributes are different, and then exchange edge attributes within the edge set, and to duplicate (copy) one edge attribute to another edge attribute. This utilizes the characteristic that edge sets tend to have more similar information than randomly selected edges, and that changes between such edge sets are less likely to create abnormal data. Moreover, it is even more desirable if it is possible to construct edge sets that can be considered to be sets of the same edge type, the node types at both ends of the edge are the same, and the node attributes at both ends of the edge are the same or similar, i.e., sets containing two or more edges.
[0402] Thus, Embodiment 5 can augment data according to the dataset or computing resources. However, creating edge tokens solely by swapping edge attributes in this way has the drawback that combinations of edge types and edge attributes cannot be freely generated.
[0403] Therefore, similar to data augmentation of node tokens, node attributes may be changed for each edge type. For example, it is desirable to calculate the width or distribution of edge attribute values and augment the data based on those widths or distributions.
[0404] The above describes data augmentation for node tokens and edge tokens, respectively. However, data augmentation may also be performed by using text in which node tokens and edge tokens are simultaneously modified in one or more places. Furthermore, it may be combined with the data augmentation shown in Embodiment 2. This improves the graphical representational power obtained from a single graph.
[0405] This feature utilizes the characteristics of graphs. For example, swapping pixels in an image or overlaying other images can result in abnormal images. Swapping words in natural language can result in sentences that are no longer grammatically correct. Therefore, domain knowledge is required to perform these swaps. In contrast, while graphs have relationships with adjacent nodes or edges, their relationships with adjacent information are weaker compared to images or natural language. Therefore, Embodiment 5 utilizes the characteristic that abnormal graphs are less likely to occur due to the aforementioned swaps.
[0406] As described above, in the graph natural language processing device 1 according to Embodiment 5, the processing unit 13 augments the data with node tokens whose node attributes have been modified. This reduces the likelihood that the combination of node type and node attributes will be fixed to text during natural language processing generation, and by introducing variability in the results, it becomes easier to generate new graphs that differ from the training data.
[0407] In the graph natural language processing device 1 according to Embodiment 5, the processing unit 13 augments data for sets of nodes that have the same node type but different node attributes by swapping node attributes between the sets or by using duplicated node tokens. This reduces the likelihood that the combination of node type and node attributes will be fixed to the text during natural language processing generation, and by introducing variability in the results, it becomes easier to generate new graphs that differ from the training data.
[0408] In the graph natural language processing device 1 according to Embodiment 5, the processing unit 13 augments data for sets of nodes that are the same type, have the same node degree, but have different node attributes, by swapping node attributes between the sets or by using duplicated node tokens. This reduces the likelihood that the combination of node type and node attributes will be fixed to the text during natural language processing generation, and by introducing variability in the results, it becomes easier to generate new graphs that differ from the training data.
[0409] In the graph natural language processing device 1 according to Embodiment 5, the processing unit 13 augments data using edge tokens with modified edge attributes. This reduces the likelihood that the combination of edge types and edge attributes generated by natural language processing will be fixed to the text during natural language processing generation, allowing for variability in the results. As a result, it becomes easier to generate new graphs that differ from the training data.
[0410] In the graph natural language processing device 1 according to Embodiment 5, the processing unit 13 augments data for edge sets that have the same edge type but different edge attributes by swapping edge attributes between edge sets or by using duplicated edge tokens. This reduces the likelihood that the combination of edge type and edge attribute generated by natural language processing will be fixed to the text during natural language processing generation, allowing for variability in the results. As a result, it becomes easier to generate new graphs that differ from the training data.
[0411] In the graph natural language processing apparatus 1 according to Embodiment 5, the processing unit 13 duplicates or replaces the edge attributes between edge sets for an edge set in which the edge types are the same, the word nodes connected to both ends of the edge are the same, and the edge attributes are different, using the edge tokens obtained by duplicating or replacing the edge attributes between the edge sets. This reduces the likelihood that the combination of edge types and edge attributes generated by natural language processing will be fixed in the text during the generation of natural language processing, and by introducing variation in the results, it becomes easier to generate a new graph that is different from the learning data.
[0412] Embodiment 6. The graph natural language processing apparatus according to Embodiment 6 applies a graph network to a circuit. The graph natural language processing apparatus according to Embodiment 6 includes the same components as the graph natural language processing apparatus 1 shown in FIG. 1, but the functions of each component are different as described later. Hereinafter, the configuration of the graph natural language processing apparatus according to Embodiment 6 will be described with reference to FIG. 1.
[0413] FIG. 19 is a circuit diagram showing a circuit to be processed in Embodiment 6. The circuit shown in FIG. 19 has a model number of "LTM805a" and shows a semiconductor having six terminals from X 1-1 to X 1-6 . An AC power supply V 1-1 is connected to the terminal X 1 of this semiconductor, 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 1-2 and X 1-3 of the semiconductor 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 is connected to the cathode terminal of the diode D 1 , a capacitor C 2 with a capacitance of 1 μF, and a resistor R 1 with a resistance value of 10 Ω. The ground is connected to the terminal X 1-6 . The ground potential of the ground is the reference potential of the circuit.
[0414] 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. Figure 20 is a diagram showing an example (1) of a graph network in Embodiment 6, and is a graph representation of the circuit in Figure 19. As shown in Figure 20, each node is assigned a node token. Ground GND does not have node attributes. Therefore, the node token consists only of the node type. The node type is the type of circuit component, and the node attribute may include circuit constants or the circuit model number. The edge type is the type of signal flowing through the wiring, and the edge attribute may include the physical or electrical characteristics of the wiring. The types of signals flowing through the wiring include high-speed signals, 3.3V power supplies, 1.5V power supplies, or differential signals. For example, when dividing 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 13 represents the node token of the frame ground FG with the string "GND:0" and the node token of the signal ground SG with the string "GND:1". This allows circuits using different grounds GND to also be represented by node tokens.
[0415] Grounds are connected by wiring or board structures constrained by physical dimensions such as capacitors or resistors, coils, residual inductance, or parasitic capacitance. Grounds are also connected to a metal enclosure or earth. Grounds may also be nodes accessed via circuit components or parasitic elements. When separating grounds, the aforementioned wiring or board structures must be considered.
[0416] In Figure 20, 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.
[0417] Furthermore, in the case of a power supply that has 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 datasets that have multiple special power supplies, such as an AC power supply with a DC bias, the node attributes may include both DC and AC power supplies. For example, if the amplitudes of the DC and AC power supplies are connected by a comma, the node token can be V:[1V,0V] for the DC power supply, V:[0V,1V] for the AC power supply, and V:[1V,1V] for the DC biased AC power supply. In addition, the phases of each phase of a three-phase AC power supply can be represented as [100V,0deg], [100V,120deg], and [100V,240deg].
[0418] Thus, as long as it can be represented as a node token, it doesn't matter whether it's represented as a node type or a node attribute. This utilizes a characteristic of natural language processing that different node tokens can be processed as having different characteristics. On the other hand, when treating a circuit as a conventional graph neural network, the results obtained differ greatly depending on whether it is treated as a node type or a node attribute, requiring adjustments for each dataset. Therefore, graphs in natural language processing have the characteristic of eliminating the need for the adjustments that were previously required.
[0419] However, it is undesirable for at least one token to appear twice or more in both the training data and the inference data. Therefore, the subdivision needs to be adjusted so that at least one node token or edge token appears twice or more. This is because, for tokens that are only used once and do not appear, inference can only be performed in the order in which they appeared in the text during training. If the node tokens or edge tokens are subdivided too much, the method of reducing the number of significant digits of the node attribute or edge attribute described in Embodiment 1 may be applied, and it is also desirable to reduce the number of elements in the node attribute or edge attribute.
[0420] Furthermore, node tokens or edge tokens may be constructed using only node types or edge types, without using node or edge attributes if necessary. However, if it is difficult to reduce the number of node tokens or edge tokens, text with the same tokens can be created by augmenting the node token or edge token nodes as described above. For this reason, if computable, it is desirable to augment the data without causing information degradation.
[0421] Based on the circuit shown in Figure 19, there are two node tokens "C:1u" in the graph of Figure 20. 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 and C 1 , C 2 C 2 , C 1 Even texts like that need to be created by inflating data to eliminate inequality.
[0422] In contrast, Embodiment 6 demonstrates that even if "C:1u" exists, the relationship between each "C:1u" and the surrounding nodes allows "C:1u" to exhibit characteristics similar to a single node ID. Therefore, since data augmentation is unnecessary, it has the unprecedented feature of enabling natural language processing.
[0423] In the graph of Figure 20, the semiconductor "X: LTM805a" has a self-loop, and the node tokens at both ends of the self-loop are semiconductors "X: LTM805a". Therefore, the text in the node center representation 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
[0424] Furthermore, according to Embodiment 5, it is also desirable to define the order of node tokens or edge tokens and represent the graph in text. When represented in this way, even if there is not just one "C:1u", it can be seen that there are two "C:1u", or that it is a different capacitor from the edge token adjacent to "C:1u".
[0425] Furthermore, the text in edge-center representation 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
[0426] In this edge-center representation, we can see that there is one or more "C:1u" points, but we cannot determine how many there are. This is because the graph is not a simple graph, but contains multiple self-loops or 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.
[0427] Figure 21 is a diagram showing an example (2) of a graph network in Embodiment 6, which is 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 an edge. In other words, the graph network is related to circuits and has node information including circuit component information and ground information, and edge information including wiring information excluding ground. Alternatively, the graph network may be related to circuits and have node information including circuit component information and wiring information, and edge information including connection information between circuit components and wiring. In Figure 20, there was one self-loop and seven multi-edges. The graph with added ground nodes shown in Figure 21 has one self-loop and one multi-edge, with a significant reduction in multi-edges, and a special effect is obtained in that the ground information essential to the circuit is not lost when the circuit is generated using natural language processing.
[0428] By adding a ground node in this way, the node center representation will have the following text: 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
[0429] Furthermore, the edge-center representation is as follows: 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
[0430] By expressing it in this way, for example, for edge token "C:1u", we can see that 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, which has the effect of creating a graph from text.
[0431] In Figure 21, there are two edges, or multiple edges, between node token "X: LTM805a" and node token "D: 1N914". When two edges are obtained through natural language processing, the terminals to which they connect are unknown, making it impossible to create a circuit from the graph data.
[0432] Furthermore, with respect to self-loops, information between the terminals of the short-circuited semiconductor is lost when the circuit is converted to a graph. For this reason, it is not possible to generate a circuit simulation or a circuit that operates on actual hardware from the text representing the graph data obtained from circuit generation. One way to solve this problem is that Embodiment 6 adds a ground node and divides it into multi-terminal nodes and terminal nodes to create a simple graph that does not include self-loops or multiple edges.
[0433] Figure 22 shows an example (3) of a graph network in Embodiment 6. As shown in Figure 22, circuit components and wiring are used as nodes, and the nodes are connected by edges to satisfy the circuit diagram. By using circuit components and wiring as nodes in this way, self-loops and multiple edges can be eliminated, resulting in a simple graph. For example, unless it is a graph generation process such as graph feature extraction in graph natural language processing, data obtained by converting the graph shown in Figure 22 into text may be used. In this case, the node center arrangement will be as follows. V e:1 e:11 C:1u e:2 e:12 e:13 e:14 e:15 e:16 N1 e:1 e:2 e:3 N2 e:4 e:5 N3 e:6 e:7 N4 e:8 e:9 e:10 e:11
[0434] In the edge-centered configuration, the following applies: e:1 V N1 e:2 N1 C:1u e:3 X:LTM805a N1 e:4 X:LTM805a N2 e:5 X:LTM805a N2 e:6 X:LTM805a N3 e:7 N3 D:1N914 e:8 D:1N914 N4 e:9 X:LTM805a N4 e:10 C:1u N4 e:11 R:10 N4 e:12 V GND e:13 C:1u GND e:14 X:LTM805a GND e:15 C:1u GND e:16 R:10 GND
[0435] However, for graph generation including circuit generation, the conversion from text to graph only involves node tokens and edge tokens and is not subject to physical constraints, so all text can be converted into a graph. However, in a graph, circuit components and wiring nodes need to be generated alternately. It is impossible to incorporate the property of generating alternately during natural language processing and it depends only on the learning data. Therefore, when they are not generated alternately, it is necessary to determine that they are abnormal graphs. As a result, compared with the case where circuit components are used as nodes and wiring is used as edges, the generation accuracy of normal graphs decreases.
[0436] Therefore, as described in Embodiment 2, a multi-terminal component such as the semiconductor "X: LTM805a" is used as nodes divided according to the number of terminals. FIG. 23 is a diagram showing an example (4) of a graph network in Embodiment 6, and shows a graph in which the semiconductor "X: LTM805a" is replaced with a star graph according to the method shown in Embodiment 2. In this graph, a node token "X: LTM805a" serving as a virtual node is arranged at the center of the terminal nodes divided for each terminal, and six terminals X 1-1 from X 1-6 corresponding node tokens are connected.
[0437] When applied to the text created using the above terminal numbers, in the node center representation, 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 X: LTM805a_5 e: 6 e: 7 e: 8 e: 21 X: LTM805a_6 e: 9 e: 22 D: 1N914 e: 5 e: 6 e: 10 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
[0438] However, since the circuit example includes terminal numbers, it is desirable to retain the terminal numbers as node tokens. However, in the case of a multi-terminal node where the terminal numbers are unknown, the node center representation can be expressed without assigning terminal numbers, 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
[0439] Furthermore, the text representation using edge-centered representation 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
[0440] Furthermore, the node token representation is as follows. V ::: X: LTM805a_1 C: 1u GND C: 1u ::: V X: LTM805a_1 GND X: LTM805a_1 ::: X: LTM805a V C: 1u X: LTM805a_2 ::: X: LTM805a X: LTM805a_3 X: LTM805a_3 ::: X: LTM805a X: LTM805a_2 X: LTM805a_4 ::: X: LTM805a D: 1N914 X: LTM805a_5 ::: X: LTM805a D: 1N914 C: 1u R: 10 X: LTM805a_6 ::: X: LTM805a GND D: 1N914 ::: X: LTM805a_4 X: LTM805a_5 C: 1u R: 10 C: 1u ::: X: LTM805a_5 R: 10 D: 1N914 GND R: 10 ::: X: LTM805a_5 C: 1u D: 1N914 GND X: LTM805a ::: X: LTM805a_1 X: LTM805a_2 X: LTM805a_3 X: LTM805a_4 X: LTM805a_5 X: LTM805a_6 GND ::: V C: 1u X: LTM805a_6 C: 1u R: 10
[0441] Furthermore, the edge token representation is as follows. V - X: LTM805a_1 V - C: 1u C: 1u - X: LTM805a_1 X: LTM805a_2 - X: LTM805a_3 X: LTM805a_4 - D: 1N914 X: LTM805a_5 - C: 1u X: LTM805a_5 - R: 10 X: LTM805a_5 - D: 1N914 X: LTM805a_6 - GND D: 1N914 - C: 1u D: 1N914 - R: 10 V - GND C: 1u - GND C: 1u - GND R: 10 - GND X: LTM805a - X: LTM805a_1 X: LTM805a - X: LTM805a_2 X: LTM805a - X: LTM805a_3 X: LTM805a - X: LTM805a_4 X: LTM805a - X: LTM805a_5 X: LTM805a - X: LTM805a_6
[0442] This representation also allows for the creation of unique text from the circuit. Furthermore, the graph may be represented as shown in Figure 24, which does not include virtual nodes, according to Embodiment 2. This is because, in Embodiment 6, which uses natural language processing, it is possible to predict that a single component is present 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.
[0443] The ability to represent decomposed partitioned nodes without using virtual nodes is unique to graph natural language processing, and the effect of using partitioned nodes is that graph information can be preserved as text. In contrast, since the number of edges does not change even when using partitioned node representation, the number of tokens included in the generated text also remains unchanged, resulting in no change in the cost of training. Furthermore, the cost of generation can be reduced, and the generation accuracy can be improved because graph information is preserved. Moreover, the fact that the number of tokens generated is small and the representation is not redundant has the notable characteristic of making it difficult to generate abnormal graph data. It should be noted that the virtual nodes and partitioned nodes of a star graph are redundant representations because their connection is obvious.
[0444] Figure 24 shows an example (5) of a graph network in Embodiment 6. In Figure 24, the text in node center representation 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
[0445] Furthermore, the text for the edge-center representation 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
[0446] The node token representation is as follows: V:::X:LTM805a_1 C:1u GND C:1u ::: V X:LTM805a_1 GND X:LTM805a_1:::V C:1u X:LTM805a_2:::X:LTM805a_3 X:LTM805a_3:::X:LTM805a_2 X:LTM805a_4:::D:1N914 X:LTM805a_5:::D:1N914 C:1u R:10 X:LTM805a_6:::GND D:1N914:::X:LTM805a_4 X:LTM805a_5 C:1u R:10 C:1u:::X:LTM805a_5 R:10 D:1N914 GND R:10:::X:LTM805a_5 C:1u D:1N914 GND GND:::V C:1u X:LTM805a_6 C:1u R:10
[0447] The edge token representation is as follows: V-X: LTM805a_1 C: 1u-X: LTM805a_1 V-C: 1u X: LTM805a_2-X: LTM805a_3 X: LTM805a_4-D: 1N914 X: LTM805a_5-C: 1u X: LTM805a_5-R: 10 X: LTM805a_5-D: 1N914 X: LTM805a_6-GND D: 1N914-C: 1u D: 1N914-R: 10 V-GND C: 1u-GND C: 1u-GND R: 10-GND
[0448] 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 containing a graph generated by natural language processing, and to generate a netlist that can be operated in a circuit simulator or on actual hardware from that 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 preferable to represent them using node center representation.
[0449] Figure 25 shows an example (6) of a graph network in Embodiment 6, illustrating an example where two identical semiconductors are included in a single graph. In Figure 25, the same semiconductor is divided into terminal nodes as a multi-terminal node. At this time, each terminal node is assigned a terminal number of the semiconductor.
[0450] Furthermore, by assigning edge tokens to terminal nodes as edges with different information, the text representation of the node center can be as follows, for example: V e:1 e7 X:LTM805a_1 e:1 X:LTM805a_2 e:2 X:LTM805a_3 e:2 X:LTM805a_4 e:3 e:3 X:LTM805a_2 e:4 X:LTM805a_3 e:9 X:LTM805a_4 e:5 e:10
[0451] In this representation, two terminal nodes composed of the same string, for example, "X:LTM805a_1", are connected to different edge tokens "e:1" and "e:3", respectively, and there are two "X:LTM805a_1" nodes of interest. Therefore, it can be seen that the two nodes of interest are connected to different circuit components. In this way, even if node tokens have the same name, if the connected wiring names are different, there is a special effect in that a node ID does not need to be assigned to the terminal node. However, if edge tokens represented by the same string are connected to the same terminal node, it becomes impossible to distinguish that they are two different components.
[0452] In such cases, it is desirable to assign features such as the node type or node attributes of both ends of the edge, the node degree, or the sum of the node degrees as edge attributes to the edge attributes that constitute the edge token. However, especially when it is difficult to assign new features to edge tokens or when the features are exactly the same, it is also possible to augment the data to eliminate inequality by assigning an edge ID to the relevant identical edge token, or by assigning a node ID to the relevant node token to eliminate inequality.
[0453] Furthermore, when connecting two different terminal nodes, for example "X: LTM805a_1", with an edge, two terminal nodes composed of the same string may have the same edge token. This type of data augmentation is small-scale, involving only a small number of node tokens or edge tokens compared to augmenting the entire graph, and can be adjusted according to computational resources and training time. Therefore, natural language processing is possible.
[0454] Unlike image or natural language processing, graph data, including circuits, is often not readily available. For example, tens of thousands to tens of millions of data points can be easily obtained for images or photographs, and several petabytes of data can be used for training in natural language processing. In contrast, with graph data, only a few data points are available at most, or even just a few.
[0455] Furthermore, depending on the data, it may be necessary to train on only one large graph network (for example, a graph network representing a social network or a road traffic network). Therefore, it is necessary to extract many features from a single data set compared to images or natural language. To address this, domain knowledge is used to augment the graph data. In this case, the graph natural language processing device 1 according to Embodiment 6 augments the data not to eliminate inequalities arising from the assignment of node IDs, but to facilitate the extraction of features from the graph data. Therefore, the former creates multiple texts from the same graph data, while the latter creates multiple texts from graph data where at least one node type or node attribute is different.
[0456] Furthermore, the former allows for a single text to be changed in one place to eliminate inequality, while the latter allows for the creation of two or more different texts to enhance the expressiveness of the data. 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.
[0457] (Data Augmentation Using Parasitic Components) Data augmentation is performed on node attributes to improve the expressiveness of graph data. Generally, changing the node type is likely to cause the circuit to malfunction, whereas changing node attributes is likely to allow the circuit to function. Specifically, by changing the node attributes related to the passive components of the circuit, it is possible to make it less likely for abnormal circuits to occur due to data augmentation. For example, changing the capacitance of a capacitor connected in parallel with a DC power supply from 1 μF to 33 μF has almost no effect on the normal operation of the circuit. For this reason, data augmentation is possible. Furthermore, data augmentation is possible not only for passive components with circuit constants but also for other components.
[0458] Replacing a diode with a specific model number with a diode of the same performance, or replacing a capacitor with a similar voltage rating or frequency characteristics, is an easy way to artificially inflate data without creating a faulty circuit. The same applies to resistors and inductors, in addition to diodes and capacitors. Furthermore, although it requires domain knowledge, in power supply circuits, it is desirable to change the boost or buck inductor, and to replace active components with similar active components.
[0459] In particular, with regard to semiconductors, from a component procurement perspective, semiconductors with general-purpose characteristics, even if they have the same terminal arrangement and similar characteristics, are often manufactured by different manufacturers. Therefore, it is relatively easy to inflate the supply of general-purpose semiconductors.
[0460] The processing unit 13 may augment data by replacing nodes representing circuit components with nodes representing two or more circuit components based on an equivalent circuit including parasitic components. In addition to changing node attributes, it is desirable to add parasitic components such as residual resistance, residual inductance, and parasitic capacitance to individual circuit components as nodes and edges for connecting those nodes to other nodes. Specifically, for example, a resistor has a residual inductance component in series with its resistance value and a parasitic capacitance component in parallel with its resistance value. Therefore, data augmentation can be achieved by adding a node token representing residual inductance in series with a node token representing resistance, and by adding a node token representing parasitic capacitance in parallel with a node token representing resistance.
[0461] The processing unit 13 may augment the data by replacing the nodes of circuit components with equivalent circuits that include parasitic components between circuit components, between circuit components and wiring, or between wirings. Figure 26 is a diagram showing an example (7) of a graph network in Embodiment 6, and shows a graph that takes into account the parasitic components of circuit components. Compared to the graph shown in Figure 20, the graph is created by adding new nodes and new edges connecting each node to an equivalent circuit of a capacitor with a residual resistance of 0.3Ω and a residual inductance of 20nH in series with capacitor "C:1u", an equivalent circuit of a capacitor with a residual resistance of 0.5Ω and a residual inductance of 30nH in series with capacitor "C:1u", and a capacitor with a residual resistance of 50mH in series with a resistor of 10Ω and a parasitic capacitance of 0.2pF in parallel with them. Furthermore, it is also desirable in this embodiment to augment the data not only by parasitic components of circuit components, but also by parasitic components between circuit components or between circuit components and wiring.
[0462] Figure 27 shows an example (8) of a graph network in Embodiment 6, and illustrates an equivalent circuit that takes into account the parasitic capacitance of 10 pF between the terminal node and the ground node of the node token "X: LTM805a_4". In this case, the parasitic capacitance is input as the combined capacitance of the parasitic capacitance between the terminal node and ground, the wiring between the terminal node and the diode "D: 1N914" and ground, and the parasitic capacitance between "D: 1N914" and ground. In this way, even if parasitic components are added, the circuit will 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.
[0463] Furthermore, based on the characteristics of the equivalent circuit, it is possible to provide a circuit with characteristics close to the actual circuit for circuits with high operating frequencies of several MHz or more, while also having no effect on 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 and wiring, and between wiring. 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.
[0464] Furthermore, when current flows through a circuit component, mutual inductance is generated in the surrounding conductors or the circuit component itself. This magnetic coupling induces an electromotive force in the surrounding conductors, while simultaneously suppressing the current in the target conductor. Such parasitic capacitance or mutual inductance not only does not create abnormal circuits, but it is also a desirable method of data augmentation, similar to that of individual circuit components. In this way, it is possible to 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.
[0465] Adding these parasitic components requires changing the number of nodes in the graph network, which in turn increases the number of node tokens or edge tokens. The change in circuit structure due to parasitic components is desirable because it increases the variability of the training data, leading to greater variability in the generated graphs and making it easier to create graphs with novel structures.
[0466] The node attribute, or edge token, that is changed for data augmentation does not necessarily have to be just one; it is permissible to change one or more edge tokens simultaneously. This is because natural language processing learns the relationships between edge tokens and their surrounding edge tokens, so even if several edge tokens around the target edge token are changed simultaneously, learning is possible as long as the graph structure or active components do not change. Furthermore, by changing one or more edge tokens for data augmentation, the amount of text input to the natural language processing system during training can be reduced, thereby improving learning efficiency.
[0467] When graph natural language processing generates a graph that can construct circuits, nodes with a node degree of "1" may be generated. A properly functioning circuit must be constructed as a closed loop. Therefore, nodes with a node degree of "1" are connected to the ground node by an edge in the circuit. This allows the circuit to be formed, making it more likely to result in a normal circuit, and is therefore desirable. However, if the connection destination of a node with a node degree of "1" is the ground node, it is desirable to remove that node.
[0468] In Figure 27, when a graph is generated for a series circuit consisting of a 10μF capacitor C, a 10Ω resistor, and a 1μF capacitor C connected to a power supply V, there are cases where the node order is "1", as in the case of 1μF shown below. In this case, it does not form a circuit, resulting in an abnormal circuit and a decrease in the accuracy of graph generation. Therefore, it is desirable to connect the 1μF capacitor to the ground node at an edge.
[0469] Furthermore, while Embodiment 2 described selecting the node with the highest node degree, in the representation shown in Embodiment 4, the ground node tends to have the highest node degree. However, all circuits have a ground node and it does not represent a circuit characteristic. Therefore, if the ground node has the highest node degree, it is desirable to select a node with a node degree of the second or lower. However, if the ground node is uniformly selected as the selection node for the entire dataset, which includes graph data based on multiple circuits, then it is also desirable to select the ground node, since all circuits have a ground and the ground serves as a common indicator.
[0470] As described above, in the graph natural language processing device 1 according to Embodiment 6, the graph network relates to a circuit and has node information including circuit component information and edge information including wiring information. This makes it possible to represent a circuit in the graph network using node types and node attributes.
[0471] In the graph natural language processing device 1 according to Embodiment 6, the graph network relates to a circuit and includes node information including circuit component information and ground information, and edge information including wiring information excluding ground. This allows the circuit to be represented in the graph network using node types and node attributes.
[0472] In the graph natural language processing apparatus 1 according to Embodiment 6, the graph network relates to a circuit and has node information including circuit component information and wiring information, and edge information including connection information between the circuit components and the wiring. Thereby, a circuit can be represented by the graph network using the node type and the node attribute.
[0473] In the graph natural language processing apparatus 1 according to Embodiment 6, the node type is the type of the circuit component, and the node attribute includes a circuit constant or a model number of the circuit. Thereby, the circuit can be converted into a graph.
[0474] In the graph natural language processing apparatus 1 according to Embodiment 6, the edge type is the type of the signal flowing through the wiring, and the edge attribute includes the physical characteristics or the electrical characteristics of the wiring. Thereby, the circuit can be converted into a graph.
[0475] In the graph natural language processing apparatus 1 according to Embodiment 6, the processing unit 13 duplicates the data by replacing a node representing a circuit component with nodes of two or more circuit components based on an equivalent circuit including parasitic components. Thereby, learning data having different graph structures or node attributes can be increased without creating an abnormal circuit.
[0476] In the graph natural language processing apparatus 1 according to Embodiment 6, the processing unit 13 duplicates the data by replacing the node of the circuit component based on an equivalent circuit including parasitic components between circuit components, between a circuit component and the wiring, or between wirings. Thereby, learning data having different graph structures or node attributes can be increased without creating an abnormal circuit.
[0477] In the graph natural language processing device 1 according to Embodiment 6, the processing unit 13 connects nodes in the text with a node degree of 1 to ground nodes representing the ground using edges. This increases the number of graphs that are determined to be normal circuits after the text generated by natural language processing is converted into a graph, thereby improving the efficiency of circuit generation. In the graph natural language processing device 1 according to Embodiment 6, the processing unit 13 removes nodes in the text that are connected only to ground nodes representing the ground and have a node degree of 1. This increases the number of graphs that are determined to be normal circuits after the text generated by natural language processing is converted into a graph, thereby improving the efficiency of circuit generation.
[0478] Embodiment 7. The graph natural language processing device according to Embodiment 7 outputs text data created by the graph natural language processing devices according to Embodiments 1 to 6 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 7 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 7 will be described below with reference to Figure 1.
[0479] (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 Embodiment 7 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 13 of the graph natural language processing unit 1 according to Embodiment 7 uses the natural language processing unit to obtain the time-series processing result of the text. Deep learning is known for time-series processing. The following describes time-series processing based on deep learning.
[0480] 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. Various methods are known for recurrent neural networks. LSTM (Long Short Term Memory) is one method that reduces the time-series forgetting that RNNs suffer from. 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.
[0481] 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.
[0482] A transformer model performs the above-mentioned processing using hardware parallel processing. The transformer model enables parallelization by incorporating an attention mechanism that handles word correlations between the encoder and decoder models of Seq2Seq. Furthermore, in addition to sequence models (also called encoder-decoder models) that combine an encoder model and a decoder model, similar to Seq2Seq, transformer models are known to include an encoder model that extracts features from input text and a decoder model that generates text from those features.
[0483] Embodiment 7 describes a method based on a transformer model. The results of processing a graph of text created using the processing shown in Embodiment 1, based on the circuit shown in Embodiment 6, 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 for the purpose of suppressing the amount of Attention memory, and include neural network models such as Mamba or Samba.
[0484] However, there are hundreds of models derived from these, and hundreds of similar technologies have also been published. Any combination of these technologies would suffice, as long as it's capable of natural language processing and can handle text as at least one of its inputs or outputs.
[0485] Furthermore, transformer models or selective state-space models are currently used in evaluation because they offer high inference accuracy. However, Embodiment 7 does not necessarily have to be a neural network-based model such as Seq2Seq, or a neural network-based method, as long as it offers high inference accuracy.
[0486] In natural language processing, a tokenizer divides text into words, and these words are replaced with single numerical values. The processing unit 13 can divide the text into edge tokens by creating text data divided using delimiters. Therefore, dividing text into words is easy.
[0487] Furthermore, the graph natural language processing device 1 according to Embodiment 7 may also include a whitespace tokenizer. The whitespace tokenizer divides the text using a half-width space " " as a first delimiter. If a custom-defined delimiter is used, a tokenizer that divides the string into words according to that delimiter may be used.
[0488] Furthermore, node tokens, edge tokens, and delimiters used to separate the node of interest from its neighbors can be used to split specific strings according to their purpose. On the other hand, two or more delimiters may be used to avoid splitting the string in a way that does not suit the purpose.
[0489] 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.
[0490] The graph natural language processing device 1 according to Embodiment 7 may include a Sentence Piece Tokenizer. The Sentence Piece Tokenizer divides the text 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. Furthermore, in order to learn text that is a mixture of text created from graph data and text used in natural language, the whitespace tokenizer has difficulty processing text used in natural language for languages that are not represented by space delimiters, such as Japanese. In contrast, a sentence-piece tokenizer is preferable because it can process text used in natural language, and can also divide text created from graphs into intended words such as node tokens or edge tokens. However, with a sentence-piece tokenizer, the designer must define the number of token types, and it is desirable to define the number of token types so that all node tokens and edge tokens in the text created from graph data are divided into words. In this case, one word corresponds to one token in natural language processing. By defining it in this way, the graph data can be input into a device that integrates a natural language processing unit and a graph natural language processing unit without losing any information from the graph data.
[0491] For example, the text data converted from the graph shown in Figure 7 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 13 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 becomes "1 7 7 2 5 3 5 6 7 4 6 7". This converted data is then input to the natural language processing unit.
[0492] Similarly, in edge-center representation, the string of text data converted from the graph shown in Figure 7 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 13 creates the following text data: "5 2 3 6 3 4 7 3 1 7 1 4".
[0493] 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.
[0494] Next, we will explain how to utilize the sequence model, encoder model, and decoder model, respectively. The sequence model can rewrite input text into other text based on the learning results, for example, as used in machine translation. This feature can be used to input the text of an entire graph into the sequence model, and the output can be 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.
[0495] The processing unit 13 may use an encoder model to input edge tokens in which a portion of the graph network has been replaced with hidden characters, and obtain the hidden characters. This allows the encoder model to perform sentiment analysis of the input natural language, or, if a portion of the text is hidden during input, predict the tokens of the hidden text.
[0496] 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 area of the board required for implementation, estimate the cost, or predict the physical quantity of heat or noise generated. In addition, edges can be predicted by inputting hidden edge tokens and predicting the hidden values. This corresponds to a process called link prediction in graph neural networks. Link prediction can be used, for example, to detect open circuits or short circuits due to aging in a circuit. Furthermore, the processing unit 13 may use a decoder model to input a portion of the text and predict the rest of the text, or it may input the entire text and create a summary of the input text. The graph natural language processing unit 1 may also input text and generate text representing a graph network in which at least one of the number of nodes, the number of edges, the node type, the node attribute, the edge type, or the edge attribute is different from the input text. In graph neural networks, this corresponds to node classification or node regression for nodes, edge classification or edge regression for edges, and graph autoencoder or graph generation for optimizing the entire graph. Thus, while graph neural networks predict each task through specialized processing, graph natural language processing can achieve similar processing with equivalent or better performance by applying natural language processing encoder or decoder models, or sequence models, without the need for specialized processing to subdivide each task.
[0497] The processing unit 13 may use a decoder model to input text data representing a part of the 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 humans can understand as natural language. By combining training data and natural language in this way, it is possible to use this for graph generation or optimization, graph understanding, and node or edge prediction.
[0498] 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.
[0499] Therefore, the processing unit 13 creates anomaly 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. The processing unit 13 then evaluates the graph using a learning device trained in binary classification (also called Anomaly Detection), which determines the training data as normal and the anomaly training data as abnormal, or in 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".
[0500] In natural language processing inference, the text output by 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. The learning device may be trained on text data created by the graph natural language processing device 1 according to Embodiments 1 to 7, or it may be a graph classification problem using a graph neural network. The anomaly detection model tends to have high generation accuracy, and when the circuit described later is used as the dataset, it has an inference accuracy of 99.58% and can be used to evaluate whether the generated graph is normal or abnormal.
[0501] For example, in the text data representing the circuit shown in Embodiment 6, even if the circuit constants, which are node attributes, change slightly, it will be treated as a normal circuit. Specifically, determining that a capacitor with a capacitance of 1 μF is normal and determining that one with a capacitance of 3.3 μF is abnormal is considered an over-determined judgment. In this case, node attributes are not used for the training data and the training data for abnormalities; training is performed using only the node type, and the generated text will also be text data consisting only of node types. The normality and abnormality of the graph data composed of the generated text will then be determined.
[0502] For example, as shown in Embodiment 6, the number of node types for node tokens may be increased using domain knowledge, thereby training an anomaly detection model with training data that includes the range of possible configurations for circuit components. This allows for the determination of anomaly data using node attributes.
[0503] 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.
[0504] 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.
[0505] The netlist is in the format that LTspice outputs by default. For example, the netlist for the semiconductor LT1026 used in a power supply circuit is shown below. In this netlist, the first word of each line represents a circuit component. The initial letter X indicates a semiconductor, C indicates a capacitor, and V indicates a power supply and node type. The "1" in "XU1" or "C1" after the initial letter represents the ID of the circuit component, which can also be used as the node ID. The last character of each line represents the characteristics of the circuit component. For example, "XU1" represents the circuit component's model number, "LT1026". "C1" represents 1 [μF], and "V1" represents 4 [V], which correspond to the node attribute. Characters other than the node type and node attribute indicate the name of the wiring connected to the circuit component. For example, in "N001", "N" corresponds to an unnamed wiring, and "001" corresponds to the edge ID. Named wires can be, for example, “OUT+” or “IN”, and “0” indicates a connection to ground. In this case, for example, wire “N001” is lined up with “XU1” and “C1” respectively, as shown below, meaning that it is a wire connected to “XU1” and “C1”. 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
[0506] The processing unit 13 inputs the above netlist into Bert, 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. The reason for performing scratch learning is that it is difficult to change the tokenizer, add or delete tokens when performing transfer learning or fine tuning of a pre-trained model. In other words, it is not possible to assign an edge token to a single token, and the edge token is divided into multiple tokens. For example, the processing unit 13 learns the text by performing scratch learning where at least each edge token, each node token, or a second delimiter is treated as a single token, and generates the text or a part of the text by inference of the trained model obtained through scratch learning. In scratch learning, edge tokens, node tokens, and second delimiters can be defined and learned as individual tokens. However, since the trained model cannot process new words such as node tokens as a single word, the characteristic that the generated text always represents a graph is lost. Furthermore, the text may be a combination of text containing words other than edge tokens, node tokens, and second delimiters, for example, text used in conventional natural language processing, and text obtained by embodiment 6 representing the graph.
[0507] The expression "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, meaning the output text is not necessarily a graph. This contradicts the objective of this embodiment, which is to improve graph generation efficiency, and is therefore undesirable. However, current natural language processing does not allow assigning new tokens to a pre-trained model. For this reason, it is desirable to perform scratch learning, starting from random numbers, rather than performing fine-tuning and transfer learning using a pre-trained model to freely determine tokens. It is also desirable to use normalized random numbers, such as those used for initializing He or Xavier. 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.
[0508] Furthermore, in order to reduce the impact of variability between training and test data, 10 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 7 is used as a graph classifier and the 3,308 netlists generated by LTspice are directly input to the natural language processing device, the inference accuracy is 96.71%. The graph natural language processing method according to Embodiment 7 yielded the following results: Node token representation was 98.14%. Edge token representation was 97.11%. Node center representation was 96.73%. Edge center representation was 97.31%.
[0509] As shown above, the inference accuracy is improved compared to when the netlist is directly input, indicating that when node IDs are replaced with node tokens or edge tokens, they contain information equivalent to or greater than that of the netlist.
[0510] Netlists use node IDs or edge IDs, which has the drawback of learning being tied to those node IDs or edge IDs. In contrast, the graph natural language processing method according to Embodiment 7 overcomes this drawback. As a result, it can be said that the information in the graph is transmitted to natural language processing without any loss of information.
[0511] Furthermore, no data augmentation was performed on the node IDs or edge IDs in the netlist from a computational cost perspective. The relatively high inference accuracy obtained by directly inputting the netlist is thought to be because the same manufacturer's circuits were used, and the rules for assigning node IDs or edge IDs are common.
[0512] 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. As a result, edge tokens equal to the number of node token combinations appeared, which is thought to have resulted in inference accuracy equivalent to when the netlist was directly input. Alternatively, the results of circuit simulation may be used for edge attributes.
[0513] In Embodiment 6, the focus has been on graph generation, but the encoder model yields results equivalent to or better than those obtained using node IDs. Therefore, in Embodiment 7, it can be confirmed that no information degradation occurs by replacing node IDs with word nodes and edge tokens.
[0514] For the decoder model experiment, a power supply circuit dataset with 2,477 circuits from the LTspice dataset was used as training data. The decoder model used was GPT-2, and the text was segmented using a whitespace tokenizer during scratch training.
[0515] 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.
[0516] 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. For this reason, to make it easier to satisfy the conditions for becoming a circuit, the processing unit 13 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 13 deletes the node with a node degree of "1".
[0517] 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%. The results of evaluating 2,477 power supply circuits generated using this trained model are as follows.
[0518] The success rate for generation based on graph neural networks is less than 0.1%. Direct input of the netlist is 2.99% (only circuits with 20 or fewer nodes are used). Node token representation is 49.43%. Edge token representation is 41.85%. Node center representation is 52.20%. Edge center representation is 48.31%. These are the experimental results that determined the circuits to be normal.
[0519] 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.
[0520] Furthermore, in Graph RNNs, which are based on graph neural networks and have high generation accuracy, nodes and edges are generated sequentially, including their types and attributes, so the computational complexity during training or generation increases exponentially. For this reason, training that converges within a week on a typical computer with four high-performance GPUs is limited to training and generating around 20 nodes. When the dataset is limited to 20 nodes or less and training is performed, 10 million graph data points are generated, and only 120 are judged to be normal. Moreover, it has been confirmed that the circuits judged to be normal are not the target circuits, i.e., circuits with a specific function. This function can often be defined by the semiconductor used, but existing methods can only output results using the target semiconductor probabilistically based on the dataset. For example, if the dataset has 10,000 types of semiconductors, and a combination of 10 of them is needed to obtain the target function, the result can only be obtained by multiplying the number of combinations of selecting 10 out of 10,000 by the probability of generating a normal graph by combining those semiconductors (0.1%). Furthermore, it is necessary to consider the probability that the generated graph will function normally as a circuit. This reasoning requires astronomical computation time and resources.
[0521] Although we applied the latest technologies other than Graph RNN, such as Graph AutoEncoder, Graph Diffusion, Graph Reinforcement Learning, and Graph GAN, it is difficult to surpass the accuracy of Graph RNN with respect to the graph data shown in Embodiment 5.
[0522] In addition to Graph RNN, we have applied the latest technologies such as Graph AutoEncoder, Graph Diffusion, Graph Reinforcement Learning, and Graph GAN, but it is difficult to surpass the accuracy of Graph RNN for the graph data shown in Embodiment 5. 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, with graph natural language processing, specific elements can be included in the text input to the trained model, so circuits containing specific circuit components or wiring can be generated with 100% efficiency.
[0523] Furthermore, when the netlist of the LTspice power supply circuit was directly input into 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 13 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, for example, that components that need to have circuit constants or part numbers do not have that information.
[0524] Based on these results, the graph natural language processing method according to Embodiment 7 improves the efficiency of generating normal circuits by more than 10 times compared to the case where a netlist is input into a natural language processing decoder model and the decoder model generates the circuit. Furthermore, conventional graph neural network-based methods cannot create a targeted circuit that includes specific circuit elements. Moreover, the probability of the generated circuit being judged as a normal circuit is low, and they are not suitable for generating data with strong physical constraints, such as circuits.
[0525] In contrast, the graph natural language processing method according to Embodiment 7 has no limitations on the number of nodes it can handle, and learning and inference can be performed on a general-purpose low-spec computer. It can generate graph data with specific elements with high accuracy.
[0526] Furthermore, these methods 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 data obtained by modifying the graph data is treated as abnormal data. An evaluation function is then created using a graph neural network. For example, the graph data acquisition unit 11 creates abnormal data obtained by at least one of the following processes: adding or deleting nodes in the normal data, adding or deleting edges, changing node information, or changing edge information, and then classifies the graph network as normal or abnormal. This allows the generated graph to be evaluated for any type of graph data without using domain knowledge.
[0527] Beyond circuits, this technology can be easily applied to, for example, inorganic compounds, proteins, genes, or physical simulation models. Physical simulation models include those that divide space into tetrahedra (finite element method) or hexahedrons (boundary element method, or FDTD method in electromagnetism). Here, the processing unit 13 may add hydrogen atoms as nodes to satisfy the valence of nodes in the generated text where the valence is less than the number of edges. For example, in the generation of molecules for inorganic compounds, if the number of edges does not match or is insufficient for the valence of atoms in the node information of the generated graph, hydrogen atoms with a valence of "1" can be added to satisfy the valence. If there are too many, a normal molecule can be generated by removing the connections with the hydrogen atoms.
[0528] Furthermore, among the physical simulation models, the finite element method divides space into tetrahedra, and each vertex node of a tetrahedron has coordinates as node information. Here, the processing unit 13 may add edges of the same type to nodes with a node degree of 2 or less in the generated text, in order of the closest nodes, and output a graph network with a node degree of 3 or more. Moreover, it is necessary to have three or more edges. For nodes with two or fewer edges, the graph can be made closer to a normal graph by creating new edges between them and adjacent nodes that are not connected by two or fewer edges.
[0529] If a graph has multiple edges or self-loops, it is desirable to remove them. Thus, after converting the generated text into a graph, it is desirable to use graph features or domain knowledge as post-processing to make it closer to a normal graph. In addition to transforming the graph structure, methods other than graph structure transformation, such as data augmentation or splitting multi-terminal nodes to increase the expressiveness of the graph, can also improve the accuracy of generating a normal graph.
[0530] As described above, the graph natural language processing device 1 according to Embodiment 7 divides text into words using a first delimiter. This makes it possible to separate a string composed of node tokens or edge tokens into individual node tokens and edge tokens.
[0531] In the graph natural language processing device 1 according to Embodiment 7, a portion of text is input, and text representing the entire graph network is generated. This makes it possible to generate an entire graph having a specified node or edge.
[0532] In the graph natural language processing device 1 according to Embodiment 7, text is input, and text is generated that represents a graph network in which at least one of the number of nodes, the number of edges, the node type, the node attribute, the edge type, or the edge attribute is different from the input text. This makes it possible to obtain an optimized graph network.
[0533] In the graph natural language processing device 1 according to Embodiment 7, text in which a portion of the text has been replaced with hidden characters is input, and text containing hidden characters or hidden characters is generated. This makes it possible to add or delete nodes or edges that constitute the graph network, and to optimize node information or edge information.
[0534] In the graph natural language processing device 1 according to Embodiment 7, text is input and the features of the graph network are output. This makes it possible to extract the features of the graph network in natural language processing.
[0535] In the graph natural language processing device 1 according to Embodiment 7, the graph data acquisition unit 11 creates abnormal data obtained by at least one of the following processes: adding and deleting nodes in normal data, adding and deleting edges, changing node information, or changing edge information, and classifies the graph network as normal or abnormal. This makes it possible to classify the normal or abnormal state of the generated graph even for data for which there is no domain knowledge.
[0536] In the graph natural language processing device 1 according to Embodiment 7, the processing unit 13 removes nodes that are connected only to ground nodes representing ground in the text and whose node order is 1. As a result, the number of graphs that are determined to be normal circuits after the text generated by natural language processing is converted into a graph increases, thereby improving the efficiency of circuit generation.
[0537] In the graph natural language processing device 1 according to Embodiment 7, the graph data pertains to inorganic compounds, and the processing unit 13 adds hydrogen atoms as nodes to nodes in the generated text whose valence is less than the number of edges, so as to satisfy the valence. This makes it possible to generate a graph of inorganic compounds based on training data.
[0538] In the graph natural language processing device 1 according to Embodiment 7, the graph data relates to finite element method mesh data, and the processing unit 13 adds edges of the same type to nodes with a node degree of 2 or less in the generated text, in order of the closest nodes, and outputs a graph network with a node degree of 3 or more. This makes it possible to generate a graph of finite element method mesh data.
[0539] In the graph natural language processing device 1 according to Embodiment 7, the processing unit 13 learns text by scratch learning, treating at least each edge token, each node token, or a second delimiter as one token, and generates text or a part of text by inference of the trained model obtained from scratch learning. As a result, the text data can be divided into node tokens or edge tokens, and since node tokens or edge tokens can be treated as a single word, it is possible to generate text that always satisfies the physical constraints that constitute the g...
Claims
1. A graph natural language processing device comprising: a graph data acquisition unit that acquires graph data constituting a graph network; an extraction unit that extracts nodes containing node information from the graph data; and a processing unit that combines the information of each node and converts it into node tokens that are processed as a single word in natural language processing, and outputs text in which the node tokens are arranged.
2. A graph natural language processing device comprising: a graph data acquisition unit that acquires graph data constituting a graph network; an extraction unit that extracts edges containing edge information from the graph data; and a processing unit that combines the edge information and converts it into edge tokens that are processed as a single word in natural language processing, and outputs text in which the edge tokens are arranged.
3. The graph natural language processing device according to claim 1, characterized in that the processing unit outputs text which is an arrangement of the node token of the node of interest and the node tokens of the nodes adjacent to the node of interest.
4. The graph natural language processing device according to claim 2, characterized in that the processing unit combines edge information including node information at both ends of an edge and converts it into an edge token.
5. The graph natural language processing device according to claim 1 or 3, characterized in that the processing unit outputs text that has a reversible transformation relationship with the graph data for at least the number of nodes and the number of edges.
6. The graph natural language processing device according to claim 2 or 4, characterized in that the processing unit outputs text that has a reversible transformation relationship with the graph data for at least the number of nodes and the number of edges.
7. The graph natural language processing device according to claim 1, characterized in that the extraction unit extracts edges containing edge information from the graph data, the processing unit converts the edge information into edge tokens that combine into a single word, and outputs text in which node tokens and edge tokens that are processed as different words in natural language processing are arranged side by side.
8. The graph natural language processing device according to claim 1, characterized in that the node information has at least one of the node type, node attributes, node degree, or edge information of the connected edge.
9. The graph natural language processing device according to claim 2, characterized in that the edge information has at least one of the edge type, edge attributes, or node information of the connected node.
10. The graph natural language processing device according to claim 1 or 8, characterized in that the processing unit outputs text having the same node token two or more times for one or more node tokens in the graph data having one or more graph networks.
11. The graph natural language processing device according to claim 2 or 9, characterized in that the processing unit outputs text having the same edge token two or more times for one or more edge tokens in graph data having one or more graph networks.
12. The graph natural language processing device according to claim 1 or 8, characterized in that the processing unit outputs text having different node tokens for one or more node tokens in graph data having one or more graph networks.
13. The graph natural language processing device according to claim 2 or 9, characterized in that the processing unit outputs text having different edge tokens for one or more edge tokens in graph data having one or more graph networks.
14. The graph natural language processing device according to claim 1 or 5, characterized in that the processing unit replaces a first delimiter in a node token with a first character not included in part of the node token, and outputs text arranged with the node tokens separated by the first delimiter.
15. The graph natural language processing device according to claim 2 or 6, characterized in that the processing unit replaces a first delimiter in an edge token with a first character not included in part of the edge token, and outputs text arranged with the edge tokens separated by the first delimiter.
16. The graph natural language processing device according to claim 7, characterized in that the processing unit replaces a first delimiter in a node token with a first character that is not included in part of a node token and is not included in part of an edge token, replaces the first delimiter in an edge token with the first character, and outputs text arranged with the node tokens, edge tokens, and node tokens and edge tokens separated by the first delimiter.
17. The graph natural language processing device according to any one of claims 14 to 16, characterized in that the first delimiter is a half-width space or two or more characters containing a half-width space.
18. The graph natural language processing device according to any one of claims 14 to 17, characterized in that it divides text into words using the first delimiter.
19. The graph natural language processing device according to claim 1 or 2, characterized in that the graph data acquisition unit creates multi-edge nodes having multiple edges and terminal nodes equal to the number of multi-edge nodes, and acquires a graph network in which the edges connected to the multi-edge nodes are each changed to connections to the terminal nodes.
20. The graph natural language processing device according to claim 1 or 2, characterized in that the graph data acquisition unit creates self-loop nodes having self-loops and terminal nodes twice the number of self-loops, and acquires a graph network in which both ends of the edges connected to the self-loop nodes are changed to connections to the terminal nodes.
21. The graph natural language processing device according to claim 1 or 2, characterized in that the graph data acquisition 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 edges connected to the multi-terminal node to connections to each terminal node, and acquires a graph network from which the multi-terminal node has been deleted.
22. The graph natural language processing device according to claim 1 or 2, characterized in that the graph data acquisition unit creates the same number of terminal nodes as the number of edges for a multi-terminal node connected to three or more edges, changes the edges connected to the multi-terminal node to connections to each terminal node, and acquires a graph network from which the multi-terminal node has been deleted.
23. The graph natural language processing device according to claim 21 or 22, characterized in that the graph data acquisition unit provides a virtual node and connects the terminal nodes via the virtual node.
24. The graph natural language processing device according to claim 19, characterized in that the graph data acquisition unit provides a virtual node and connects the terminal nodes and the multi-edge nodes after the terminal nodes and edges have been changed to connections to the terminal nodes via the virtual node.
25. The graph natural language processing device according to claim 20, characterized in that the graph data acquisition unit provides a virtual node and connects the terminal nodes and the self-loop node after changing the connections between the terminal nodes and both ends of the edge to the terminal nodes via the virtual node.
26. The graph natural language processing device according to claim 1, claim 2, and any one of claims 19 to 22, characterized in that the graph data acquisition unit acquires the graph network as a simple graph.
27. The graph natural language processing device according to claim 8, characterized in that the edge information of the edges connected to nodes having two or more identical node information is different.
28. The graph natural language processing device according to claim 9, wherein in the graph network having two or more identical edge tokens, at least one node token of the nodes connected to both ends of the edge is different.
29. The graph natural language processing device according to claim 6 or 7, characterized in that the processing unit arranges edge tokens based on at least one of the following: a statistical value including the sum, maximum, or average of the node degrees of the nodes connected to both ends of the edge, the distance from a selected node selected from the graph network, the terminal number of the node, or lexicographical order.
30. The graph natural language processing device according to claim 5 or 7, characterized in that the processing unit arranges node tokens based on at least one of the node degree, the distance from a selected node selected from the graph network, or lexicographical order.
31. The graph natural language processing device according to claim 6 or 7, characterized in that the processing unit adds a string of edge tokens sorted under the same conditions based on at least one of the following: a statistical value including the sum, maximum, or average of the node degrees of the nodes connected to both ends of the edge, the distance from a selected node selected from the graph network, or the terminal number of the node.
32. The graph natural language processing device according to claim 5 or 7, characterized in that the processing unit adds text in which node tokens of the same condition are rearranged based on at least one of the node order or the distance from a selected node selected from the graph network.
33. The graph natural language processing device according to claim 5, characterized in that the processing unit outputs text in which the node token of the node of interest and the node tokens of nodes adjacent to the node of interest in the graph network are arranged using a second delimiter that is not included in part of the node tokens.
34. The graph natural language processing device according to claim 14, characterized in that the processing unit outputs text arranged by separating the node tokens and the node tokens and the second delimiter using the first delimiter, with respect to a second delimiter different from the first delimiter.
35. The graph natural language processing device according to claim 15, characterized in that the processing unit outputs text which is an arrangement of node information at both ends of an edge, a third delimiter not included in part of the node token formed by combining the node information, and an edge token which is a combination of the node token and the third delimiter.
36. The graph natural language processing device according to 35, characterized in that the third delimiter does not include the first delimiter.
37. The graph natural language processing device according to claim 7, characterized in that the processing unit outputs the text which is an arrangement of the node token of the node of interest and the edge token of the edge connected to the node of interest.
38. The graph natural language processing device according to claim 7, characterized in that the processing unit outputs text arranged with the edge token of the edge of interest and the node tokens of the nodes connected to both ends of the edge of interest.
39. The graph natural language processing device according to claim 33, characterized in that only the source node is designated as the node of interest.
40. The graph natural language processing device according to claim 35, characterized in that the processing unit places the node token of the source node to the left of the third delimiter and the node token of the sink node to the right of the third delimiter.
41. The graph natural language processing device according to claim 37, characterized in that the edge information includes information regarding the orientation of the edge relative to the node of interest.
42. The graph natural language processing device according to 38, wherein the edge information includes the orientation of the edge, and the processing unit outputs the text in which the word nodes of the nodes connected to the end of the unidirectional edge of interest are arranged in the direction from the source node to the sink node, based on the orientation of the edge included in the edge information.
43. The graph natural language processing device according to claim 1 or 2, wherein the graph network relates to a circuit and has node information including circuit component information and edge information including wiring information.
44. The graph natural language processing device according to claim 1 or 2, wherein the graph network relates to a circuit and has node information including circuit component information and ground information, and edge information including wiring information excluding ground.
45. The graph natural language processing device according to claim 1 or 2, wherein the graph network relates to a circuit and has node information including circuit component information and wiring information, and edge information including connection information between circuit components and wiring.
46. The graph natural language processing device according to claim 12 and any one of claims 43 to 45, characterized in that the node type is the type of circuit component and the node attribute includes a circuit constant or a circuit model number.
47. The graph natural language processing device according to claim 13 and any one of claims 43 to 45, characterized in that the edge type is the type of signal flowing through the wiring, and the edge attribute includes the physical or electrical characteristics of the wiring.
48. The graph natural language processing device according to any one of claims 43 to 45, characterized in that the processing unit augments data by replacing nodes representing circuit components with nodes of two or more circuit components based on an equivalent circuit including parasitic components.
49. The graph natural language processing device according to any one of claims 43 to 45, characterized in that the processing unit augments data by replacing the nodes of circuit components with equivalent circuits that include parasitic components between circuit components, between circuit components and wiring, or between wiring.
50. The graph natural language processing device according to claim 18, characterized in that it takes a portion of text as input and generates text representing the entire graph network.
51. The graph natural language processing device according to claim 18, characterized in that it takes text as input and generates text representing the graph network in which at least one of the number of nodes, the number of edges, the node type, the node attribute, the edge type, or the edge attribute is different from the input text.
52. A graph natural language processing device according to any one of claims 1 to 5, characterized in that it takes input text in which a portion of the text has been replaced with hidden characters, and generates the hidden characters or text containing the hidden characters.
53. The graph natural language processing device according to claim 18, characterized in that it takes text as input and outputs the feature quantities of the graph network.
54. The graph natural language processing device according to any one of claims 50 to 52, characterized in that the graph data acquisition unit creates abnormal data obtained by at least one of the following processes: adding and deleting nodes in normal data, adding and deleting edges, changing node information, or changing edge information, and classifies the graph network as normal or abnormal.
55. The graph natural language processing device according to claim 12 and any one of claims 50 to 52, characterized in that the processing unit connects nodes in the text whose node degree is 1 with ground nodes representing the ground using edges.
56. The graph natural language processing device according to claim 44 and any one of claims 50 to 52, characterized in that the processing unit is connected only to ground nodes representing ground among the nodes in the text and removes nodes with a node degree of 1.
57. The graph natural language processing device according to any one of claims 50 to 52, wherein the graph data relates to an inorganic compound, and the processing unit adds hydrogen atoms as nodes to nodes in the generated text whose valence is less than the number of edges, so as to satisfy the valence.
58. The graph natural language processing device according to any one of claims 50 to 52, wherein the graph data relates to mesh data of the finite element method, and the processing unit adds edges of the same type to nodes with a node degree of 2 or less among the nodes in the generated text, in order of the closest nodes, and outputs the graph network with a node degree of 3 or more.
59. The graph natural language processing device according to claim 33 and any one of claims 50 to 53, characterized in that the processing unit learns text by scratch learning with at least each edge token, each node token, or a second delimiter as one token, and generates text or a part of text by inference of the trained model obtained by scratch learning.
60. The graph natural language processing device according to any one of claims 10, 27, and 30, characterized in that the processing unit outputs text containing node tokens that are represented by the same string two or more times for at least one node token by rounding the numerical values of node attributes, aggregating node types, deleting numerical information or type information, or augmenting data.
61. The graph natural language processing device according to any one of claims 11, 28, and 29, characterized in that the processing unit outputs text containing edge tokens that are represented by the same string two or more times for at least one edge token by rounding the numerical values of edge attributes, aggregating edge types, deleting numerical information or type information, or augmenting data.
62. The graph natural language processing device according to claim 12 or 27, characterized in that the processing unit changes node tokens represented by the same string that are connected to edge tokens represented by the same string, to node tokens with different node information, by adding node order, distance from one or more selected nodes selected from the graph network, or edge information.
63. The graph natural language processing device according to claim 13 or 28, characterized in that the processing unit changes at least one edge token, which is represented by the same string and connected to a node token, which is represented by the same string and connected to both ends of the edge, to an edge token with different edge information, by adding a statistical value including the sum, maximum, or average of the node degrees of the nodes connected to both ends of the edge, the distance from one or more selected nodes selected from the graph network, or node information of the nodes connected to both ends of the edge.
64. The graph natural language processing device according to claim 7, characterized in that the processing unit connects edge tokens composed of the same string to different node tokens composed of the same string.
65. The graph natural language processing device according to claim 29 or 30, characterized in that the processing unit simultaneously fixes the order in which node tokens are arranged and the order in which edge tokens are arranged.
66. The graph natural language processing device according to claim 32, characterized in that the processing unit augments data with node tokens whose node attributes have been modified.
67. The graph natural language processing device according to 32, characterized in that the processing unit augments data for a set of nodes of the same node type but different node attributes by swapping or duplicating node tokens between the node sets.
68. The graph natural language processing device according to 32, characterized in that the processing unit augments data for a set of nodes that are of the same type, have the same node degree, and have different node attributes by swapping or duplicating node tokens between the set of nodes.
69. The graph natural language processing device according to claim 31, characterized in that the processing unit augments data with edge tokens whose edge attributes have been modified.
70. The graph natural language processing device according to claim 31, characterized in that the processing unit augments data for a set of edges that have the same edge type but different edge attributes by swapping or duplicating edge tokens between the edge sets.
71. The graph natural language processing device according to claim 31, characterized in that the processing unit augments data for edge sets in which the edge type is the same, the word nodes connected to both ends of the edge are the same, and the edge attributes are different, by swapping or duplicating edge tokens between the edge sets.
72. The graph natural language processing device according to claim 7, characterized in that the processing unit connects edge tokens with different edge information to edges connected to node tokens represented by two or more identical strings.
73. The graph natural language processing device according to any one of claims 7, 21, and 22, characterized in that the processing unit connects edge tokens with different edge information to edges connected to node tokens representing terminal nodes represented by the same string.
74. The graph natural language processing device according to claim 7, characterized in that the processing unit assigns node IDs to node tokens represented by two or more identical strings and performs data augmentation by changing the combination of node IDs.
75. 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 constituting a graph network; a step of an extraction unit extracting nodes containing node information from the graph data; and a step of a processing unit combining each node information and converting it into node tokens that are processed as one word in natural language processing, and outputting text in which the node tokens are arranged.
76. The graph natural language processing method according to 75, characterized in that the processing unit outputs text in which the node token of the node of interest and the node token of a node adjacent to the node of interest are arranged side by side.
77. 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 constituting a graph network; a step of an extraction unit extracting edges including edge information from the graph data; and a step of a processing unit combining the edge information and converting it into edge tokens that are processed as one word in natural language processing, and outputting text in which the edge tokens are arranged.
78. The graph natural language processing method according to 77, characterized in that the processing unit combines edge information including node information at both ends of an edge and converts it into an edge token.
79. A program to cause a computer to function as: a graph data acquisition unit that acquires graph data constituting a graph network; an extraction unit that extracts nodes containing node information from the graph data; and a processing unit that combines the information of each node and converts it into node tokens that are processed as a single word using natural language processing, and outputs text in which the node tokens are arranged.
80. A program to cause a computer to function as: a graph data acquisition unit that acquires graph data constituting a graph network; an extraction unit that extracts edges containing edge information from the graph data; and a processing unit that combines the edge information and converts it into edge tokens that are processed as a single word using natural language processing, and outputs text in which the edge tokens are arranged.