Structure diagram generation method, model training method, atlas generation method and device

By performing context encoding on the statements to be processed and training a deep learning model, node information, topological structure information, and edge information are generated, solving the problem of accuracy in open-domain information extraction and achieving efficient and accurate generation of structural graphs and graph maps.

CN114756691BActive Publication Date: 2026-02-10BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210432872.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-22
Publication Date
2026-02-10
Estimated Expiration
2042-04-22

AI Technical Summary

Technical Problem

Existing technologies face challenges in accurately and effectively extracting information from open-domain information, making it difficult to generate high-quality structural diagrams and maps.

Method used

A structural graph generation method is adopted, which generates node information, topological structure information and edge information by context encoding the statement to be processed, and uses a deep learning model to train a structural graph generation model to generate a target structural graph and apply it to graph generation.

Benefits of technology

It improves the efficiency and accuracy of open-domain information processing, enhances information extraction capabilities, enriches the domain scope of the map, reduces the difficulty of analysis, and reduces cascading errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114756691B_ABST
    Figure CN114756691B_ABST
Patent Text Reader

Abstract

The present disclosure provides a structure graph generation method, a structure graph generation model training method, a graph generation method and device, an electronic device, a storage medium and a program product, relates to the technical field of data processing, and in particular to the technical field of graph, deep learning and the like. The specific implementation scheme is as follows: context encoding is performed on a to-be-processed sentence to obtain an encoding vector sequence; based on the encoding vector sequence, node information, topological structure information and edge information used for generating a structure graph are determined, the node information is used to represent attribute information of nodes of the structure graph, the topological structure information is used to represent whether edges exist between the nodes, and the edge information is used to represent an association relationship between the nodes; and based on the node information, the topological structure information and the edge information, a target structure graph for the to-be-processed sentence is generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, and in particular to the fields of graph generation and deep learning. Specifically, it relates to methods for generating structure graphs, training methods for structure graph generation models, graph generation methods, devices, electronic devices, storage media, and software products. Background Technology

[0002] Information extraction technology plays a crucial role in the field of artificial intelligence, with an increasing number of AI research and applications relying on it. For example, content is extracted from open-domain information to generate knowledge graphs, enriching and supplementing knowledge bases for applications in retrieval, human-computer interaction, and other areas. Another example is the generation of event graphs from open-domain information, which can clearly outline the relationships between multiple events. How to accurately and effectively extract information from open-domain information has become a key research focus. Summary of the Invention

[0003] This disclosure provides a method for generating structural diagrams, a method for training structural diagram generation models, a method for generating graphs, an apparatus, an electronic device, a storage medium, and a program product.

[0004] According to one aspect of this disclosure, a method for generating a structure graph is provided, comprising: performing context encoding on a statement to be processed to obtain an encoding vector sequence; determining node information, topological structure information, and edge information for generating a structure graph based on the encoding vector sequence, wherein the node information is used to characterize the attribute information of the nodes in the structure graph, the topological structure information is used to characterize whether there are edges between multiple nodes, and the edge information is used to characterize the association relationship between the multiple nodes; and generating a target structure graph for the statement to be processed based on the node information, the topological structure information, and the edge information.

[0005] According to another aspect of this disclosure, a training method for a structural graph generation model is provided. The structural graph generation model includes a context encoding sub-model, a node label generation sub-model, a topology generation sub-model, and an edge label generation sub-model. The training method includes: inputting sample statements corresponding to a sample structural graph into the context encoding sub-model to obtain a sample encoding vector sequence, wherein the sample structural graph includes sample node labels, sample topology labels, and sample edge labels; inputting the sample encoding vector sequence into the node label generation sub-model to obtain sample node information; inputting the sample statements into the topology generation sub-model to obtain sample topology information; inputting the sample statements into the edge label generation sub-model to obtain sample edge information; and training the structural graph generation model based on the sample structural graph, the sample node information, the sample topology information, and the sample edge information to obtain a trained structural graph generation model.

[0006] According to another aspect of this disclosure, a map generation method is provided, comprising: generating a target map based on a structural map, wherein the structural map is generated using the structural map generation method of this disclosure.

[0007] According to another aspect of this disclosure, a structure graph generation apparatus is provided, comprising: an encoding module for performing context encoding on a statement to be processed to obtain an encoding vector sequence; a determining module for determining node information, topological structure information, and edge information for generating a structure graph based on the encoding vector sequence, wherein the node information is used to characterize the attribute information of nodes in the structure graph, the topological structure information is used to characterize whether there are edges between multiple nodes, and the edge information is used to characterize the association relationship between the multiple nodes; and a structure graph generation module for generating a target structure graph for the statement to be processed based on the node information, the topological structure information, and the edge information.

[0008] According to another aspect of this disclosure, a training apparatus for a structural graph generation model is provided, wherein the structural graph generation model includes a context encoding sub-model, a node label generation sub-model, a topology generation sub-model, and an edge label generation sub-model. The training apparatus for the structural graph generation model includes: a first input module, used to input sample statements corresponding to a sample structural graph into the context encoding sub-model to obtain a sample encoding vector sequence, wherein the sample structural graph includes sample node labels, sample topology labels, and sample edge labels; a second input module, used to input the sample encoding vector sequence into the node label generation sub-model to obtain sample node information; a third input module, used to input the sample statements into the topology generation sub-model to obtain sample topology information; a fourth input module, used to input the sample statements into the edge label generation sub-model to obtain sample edge information; and a training module, used to train the structural graph generation model based on the sample structural graph, the sample node information, the sample topology information, and the sample edge information to obtain a trained structural graph generation model.

[0009] According to another aspect of this disclosure, a map generation apparatus is provided, comprising: a map generation module for generating a target map based on a structural map, wherein the structural map is generated using the structural map generation apparatus described in this disclosure.

[0010] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to said at least one processor; wherein the memory stores instructions executable by said at least one processor, said instructions being executed by said at least one processor to enable said at least one processor to perform a method as disclosed herein.

[0011] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform the methods as disclosed herein.

[0012] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method as disclosed herein.

[0013] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0014] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0015] Figure 1 This illustration schematically shows an exemplary system architecture to which the structural diagram generation method and apparatus can be applied according to embodiments of the present disclosure;

[0016] Figure 2 A structural diagram according to an embodiment of the present disclosure is shown schematically;

[0017] Figure 3 A flowchart illustrating a method for generating a structural diagram according to an embodiment of the present disclosure is shown schematically.

[0018] Figure 4 A schematic diagram of a structural diagram generation model according to an embodiment of the present disclosure is shown.

[0019] Figure 5 A schematic diagram illustrating the generated target structure diagram according to an embodiment of the present disclosure is shown.

[0020] Figure 6 A flowchart illustrating a training method for a block diagram generation model according to an embodiment of the present disclosure is shown schematically.

[0021] Figure 7 A flowchart illustrating a map generation method according to an embodiment of the present disclosure is shown schematically.

[0022] Figure 8 A block diagram of a structural diagram generation apparatus according to an embodiment of the present disclosure is shown schematically;

[0023] Figure 9 A block diagram of a training apparatus for generating a model from a structural diagram according to an embodiment of the present disclosure is shown schematically.

[0024] Figure 10 A block diagram of a map generation apparatus according to an embodiment of the present disclosure is schematically shown; and

[0025] Figure 11 A block diagram of an electronic device suitable for implementing a structural diagram generation method according to an embodiment of the present disclosure is shown schematically. Detailed Implementation

[0026] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0027] This disclosure provides a method for generating structural diagrams, a method for training structural diagram generation models, a method for generating graphs, an apparatus, an electronic device, a storage medium, and a program product.

[0028] According to embodiments of this disclosure, a method for generating a structure graph is provided, which may include: performing context encoding on a statement to be processed to obtain an encoding vector sequence; determining node information, topological structure information, and edge information for generating a structure graph based on the encoding vector sequence, wherein the node information is used to characterize the attribute information of the nodes in the structure graph, the topological structure information is used to characterize whether there are edges between multiple nodes, and the edge information is used to characterize the association relationship between multiple nodes; and generating a target structure graph for the statement to be processed based on the node information, topological structure information, and edge information.

[0029] In the technical solution disclosed herein, the collection, storage, use, processing, transmission, provision, disclosure, and application of user personal information comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and there is no violation of public order and good morals.

[0030] In the technical solution disclosed herein, the user's authorization or consent is obtained before acquiring or collecting the user's personal information.

[0031] Figure 1 The illustration schematically shows an exemplary system architecture to which the structural diagram generation method and apparatus can be applied according to embodiments of the present disclosure.

[0032] It is important to note that Figure 1 The examples shown are merely examples of system architectures that can be applied to the embodiments of this disclosure, to help those skilled in the art understand the technical content of this disclosure, but do not mean that the embodiments of this disclosure cannot be used in other devices, systems, environments, or scenarios. For example, in another embodiment, an exemplary system architecture to which the structural diagram generation method and apparatus can be applied may include a terminal device, but the terminal device can implement the structural diagram generation method and apparatus provided by the embodiments of this disclosure without interacting with the server.

[0033] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, and 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the terminal devices 101, 102, and 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0034] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software, etc. (for example only).

[0035] Terminal devices 101, 102, and 103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0036] Server 105 can be a server that provides various services, such as a backend management server that supports the content browsed by users using terminal devices 101, 102, and 103 (for example only). The backend management server can process the pending statements received from terminal devices 101, 102, and 103, such as generating a structure diagram, and generate a target structure diagram.

[0037] It should be noted that the structural diagram generation method provided in this embodiment can generally be executed by terminal devices 101, 102, or 103. Correspondingly, the structural diagram generation apparatus provided in this embodiment can also be disposed in terminal devices 101, 102, or 103.

[0038] Alternatively, the structural diagram generation method provided in this embodiment can generally be executed by server 105. Correspondingly, the structural diagram generation apparatus provided in this embodiment can generally be located in server 105. The structural diagram generation method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105. Correspondingly, the structural diagram generation apparatus provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105.

[0039] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0040] It should be noted that the sequence numbers of the operations in the following methods are for descriptive purposes only and should not be considered as indicating the execution order of the operations. Unless explicitly stated otherwise, the method does not need to be executed in the exact order shown.

[0041] According to embodiments of this disclosure, a structure graph can refer to a general intermediate representation for information extraction. The structure graph can be generated based on sentence-level corpora, and it can also be a word-level structure graph. The structure graph can be used to generate "open-domain information representations," i.e., phrase structure graphs.

[0042] According to embodiments of this disclosure, a structure graph may include nodes and edges. The structure graph may also include node information, such as attribute information that characterizes the nodes of the structure graph. Edges in the structure graph can be determined using topological information; that is, topological information can be used to determine whether an edge exists between two nodes. The structure graph may also include edge information, which characterizes the association relationship between any two nodes with an edge.

[0043] Figure 2 A structural diagram according to an embodiment of the present disclosure is shown schematically. Figure 2 In the diagram, circular boxes represent byte nodes; dashed elliptical boxes represent node information; dashed rectangular boxes represent edge information; and solid elliptical boxes represent phrase nodes.

[0044] like Figure 2 As shown, the structure graph is a word-level structure graph of the statement "is that true". Nodes 211 of structure graph 210 include nodes "is", "that", and "true". Edges 212 of the structure graph include the edge between the nodes "is" and "that", and the edge between the nodes "is" and "true". Node information 213 includes, for example, information about the node "is" that indicates the generation of derived nodes from this node, such as "attached node wether". Node information 213 also includes information about the node "that" that indicates the generation of derived nodes from this node, such as "no attachment". Edge information 214 can include information representing the relationship between the nodes "is" and "that", such as "subject-verb" information. Edge information 214 can also include information representing the relationship between the nodes "is" and "true", such as "next word" information.

[0045] like Figure 2 As shown, the structure graph generation method provided in this embodiment can convert sentence-level corpora into character-level structure graphs. Then, phrase combinations can be performed on the nodes in the character-level structure graph to generate "open-domain information representations," such as phrase structure graph 220. Transforming the "open-domain information representations" yields a graph 230, such as a knowledge graph or a context graph.

[0046] According to the embodiments of this disclosure, the structural diagram generation method provided by the embodiments of this disclosure can improve the processing efficiency and accuracy of the initial processing stage of various open domain information, thereby improving the subsequent information extraction capability and enriching the domain scope of the graph.

[0047] Figure 3 A flowchart illustrating a method for generating a structural diagram according to an embodiment of the present disclosure is shown schematically.

[0048] like Figure 3 As shown, the method includes operations S310 to S330.

[0049] In operation S310, the statement to be processed is context-encoded to obtain an encoded vector sequence.

[0050] In operation S320, based on the encoded vector sequence, node information, topological structure information, and edge information are determined to generate the structure graph. Node information is used to characterize the attribute information of the nodes in the structure graph, topological structure information is used to characterize whether there are edges between multiple nodes, and edge information is used to characterize the association relationships between multiple nodes.

[0051] In operation S330, a target structure graph is generated based on node information, topology information, and edge information for the statement to be processed.

[0052] According to embodiments of this disclosure, the statements to be processed can be sentence-level corpora. The type of statements to be processed is not limited; for example, it can be text corpora in English, Chinese, or other languages.

[0053] According to embodiments of this disclosure, for operation S310, performing context encoding on the statement to be processed to obtain an encoded vector sequence may include: inputting the statement to be processed into a context encoding sub-model to obtain the encoded vector sequence. The structure of the context encoding sub-model is not limited; any deep learning model that can perform context encoding processing by combining the contextual semantics of the content in the statement to be processed while encoding the content itself is also acceptable.

[0054] According to embodiments of this disclosure, the statement to be processed can be split into multiple "character-level" single texts. For example, in Chinese, the statement to be processed can be split into multiple single texts at the character level; in English, the statement to be processed can be split into multiple single texts at the word level. The target structure diagram may include multiple nodes. Each node corresponds one-to-one with a single text in the statement to be processed. The encoding vector sequence may include multiple encoding vectors. Each single text corresponds one-to-one with a multiple encoding vector.

[0055] According to embodiments of this disclosure, processing the encoded vector sequence in operation S320 to determine the node information, topology information, and edge information for generating the structure graph may include: inputting the encoded vector sequence into a node label generation sub-model to obtain node information; inputting the encoded vector sequence into a topology generation sub-model to obtain topology information; and inputting the encoded vector sequence into an edge label generation sub-model to obtain edge information. The model structures of the node label generation sub-model, topology generation sub-model, and edge label generation sub-model are not limited, as long as they are deep learning models capable of achieving the above functions.

[0056] According to embodiments of this disclosure, for operation S330, generating a target structure graph for the statement to be processed based on node information, topology information, and edge information may include: each single text in the statement to be processed is a node. Node information representing node attributes may be attached to each node. Based on the topology information, it is determined whether an edge exists between any two nodes in the statement to be processed; that is, edges are generated based on the topology information. And based on the edge information, edge information representing the association relationship between the two nodes is attached to the two nodes that have an edge.

[0057] According to embodiments of this disclosure, a deep learning model can be used to process the statement to be processed and generate a target structure graph. However, it is not limited to this. Syntactic analysis or rules can also be used to generate a target structure graph based on the statement to be processed.

[0058] According to embodiments of this disclosure, using a deep learning model to generate target structure graphs allows for processing of data from various open domains, thereby expanding the scope of structure graph generation. Furthermore, it reduces the analytical difficulty of generating structure graphs, improves analytical accuracy, and avoids cascading errors caused by syntactic analysis or rules.

[0059] According to embodiments of this disclosure, for operation S320, determining node information, topological structure information, and edge information for generating a structure graph based on the encoded vector sequence may include: performing a first transformation process on the encoded vector sequence to obtain a topological structure representation; determining the topological structure information based on the topological structure representation; performing a second transformation process on the encoded vector sequence to obtain a relation representation; determining the edge information based on the relation representation; and determining the node information based on the encoded vector sequence.

[0060] According to embodiments of this disclosure, the first transformation process may be a bilinear transformation process or a biaffine transformation process.

[0061] According to embodiments of this disclosure, the second transformation process can be a bilinear transformation process or a biaffine transformation process.

[0062] According to embodiments of this disclosure, a neural network-based structure graph generation method is provided, which uses a structure graph generation model to process statements to be processed and generates a target structure graph for the statements to be processed.

[0063] Figure 4 A schematic diagram of a structural diagram generation model according to an embodiment of the present disclosure is shown.

[0064] like Figure 4 As shown, the structure graph generation model may include a context encoding sub-model M410, a node label generation sub-model M420, a topology generation sub-model M430, and an edge label generation sub-model M440.

[0065] like Figure 4 As shown, the statement to be processed, D410, can be input into the context encoding sub-model M410 to obtain the encoded vector sequence D420 containing context information. The encoded vector sequence D420 can be input into the node label generation sub-model M420 to obtain node information D430. The encoded vector sequence D410 can be input into the topology generation sub-model M430 to obtain topology information D440. The encoded vector sequence D420 can be input into the edge label generation sub-model M440 to obtain edge information D450.

[0066] According to embodiments of this disclosure, the context encoding sub-model may include one or more of the following: RNN (Recurrent Neural Network), LSTM (Long Short-Term Memory), GRU (Gate Recurrent Unit), CNN (Convolutional Neural Networks), BERT (Bidirectional Encoder Representation from Transformers), and ERNIE (Enhanced Representation from kNowledge IntEgration).

[0067] like Figure 4 As shown, the node label generation sub-model M420 may include an attribute processing module M421. The encoded vector sequence D420 can be input into the attribute processing module M421 to generate node information D430. That is, the attribute processing module can be used to process the node attributes of the encoded vector sequence to obtain node information about the node attributes. According to embodiments of this disclosure, the attribute processing module may include: cascaded fully connected layers and node activation layers. The node activation layer may include a Softmax activation function or a Sigmoid activation function.

[0068] like Figure 4 As shown, the topology generation sub-model M430 may include a cascaded first transformation module M431 and a topology generation module M432. The first transformation module M431 can be used to perform a first transformation on the encoded vector sequence D420 to obtain a topology representation. Based on this topology representation, the topology generation module M432 determines the topology information D440.

[0069] According to embodiments of this disclosure, the first transformation module may include a bilinear transformation function or a biaffine transformation function. However, it is not limited to these. It may also include any other bilinear transformation function.

[0070] According to embodiments of this disclosure, the topology generation module may include cascaded fully connected topology layers and topology activation layers. The topology activation layer may include a Softmax activation function or a Sigmoid activation function.

[0071] like Figure 4 As shown, the edge label generation sub-model M440 may include a cascaded second transformation module M441 and an edge label generation module M442. The second transformation module M441 can be used to perform a second transformation on the encoded vector sequence D420 to obtain a relational representation. Based on this relational representation, the edge information D450 is determined using the edge label generation module M442.

[0072] According to embodiments of this disclosure, the second transformation module may include a bilinear transformation function or a biaffine transformation function. However, it is not limited to these. It may also include any other bilinear transformation function.

[0073] According to embodiments of this disclosure, the edge label generation module may include: a cascaded fully connected layer for edge labels and an edge label activation layer. The edge label activation layer may include a Softmax activation function or a Sigmoid activation function.

[0074] According to embodiments of this disclosure, performing a first transformation on the encoded vector sequence to obtain a topological representation may include: for any two nodes in the statement to be processed, determining the encoded vector pair corresponding to the two nodes from the encoded vector sequence; and performing a first transformation on the encoded vector pair to obtain a topological representation regarding the relationship between the two nodes.

[0075] For example, for any two byte points, byte point i and byte point j, in the statement to be processed, the encoding vector i corresponding to byte point i and the encoding vector j corresponding to byte point j are determined from the encoding vector sequence, forming an encoding vector pair. The first transformation processing module performs a biaffine transformation on the encoding vector pair to obtain the first adjacency tensor between byte points i and j, i.e., the topological structure representation. The topological structure representation is processed by the topology generation module to generate a result indicating whether an edge exists between byte points i and j. For example, it outputs a probability value between 0 and 1, and uses probability values ​​greater than a predetermined threshold, such as 0.8, as topological structure information indicating the presence of an edge, and probability values ​​less than or equal to the predetermined threshold as topological structure information indicating the absence of an edge.

[0076] According to embodiments of this disclosure, performing a second transformation on the encoded vector sequence to obtain a relational representation may include: for any two nodes in the statement to be processed, determining the encoded vector pair corresponding to the two nodes from the encoded vector sequence; and performing a second transformation on the encoded vector pair based on the number of edge information categories to obtain a relational representation between the two nodes.

[0077] For example, for any two byte points, byte point i and byte point j, in the statement to be processed, the encoding vector i corresponding to byte point i and the encoding vector j corresponding to byte point j are determined from the encoding vector sequence, forming an encoding vector pair. Based on the number of edge information categories, the second transformation processing module performs a biaffine transformation on the encoding vector pair to obtain the second adjacency tensor between byte points i and j, i.e., the relation representation. The edge labeling module processes the relation representation to generate edge information results for all edge information categories between byte points i and j, and the edge information result corresponding to the edge information category with the highest confidence is taken as the edge information.

[0078] Figure 5 A schematic diagram illustrating the generated target structure diagram according to an embodiment of the present disclosure is shown. Figure 5 In the diagram, circular boxes represent nodes; dashed elliptical boxes represent node information; and dashed rectangular boxes represent edge information.

[0079] like Figure 5 As shown, node information 520 for each of the multiple nodes 510 for the statement "is that true", topological structure information 530 for representing whether there are edges between the multiple nodes, and edge information 540 for representing the relationship between two nodes are obtained.

[0080] like Figure 5 As shown, node information 520, topology information 530, and edge information 540 can be combined to generate a target structure graph for the statement "is that true".

[0081] According to embodiments of this disclosure, node information used to characterize node attributes may include one or more of the following: node part-of-speech information and derived node information used to characterize whether a derived node is generated. Node part-of-speech information may include, for example, noun, verb, or adjective part-of-speech information, and may also include, for example, subject or predicate part-of-speech information. Derived node information used to characterize whether a derived node is generated may include, for example, derived node information indicating whether the node "whether" is appended.

[0082] According to embodiments of this disclosure, edge information may include the relationships between multiple nodes. Based on the edge information and topology information, edge information between two nodes that do not have an edge can be deleted, while edge information between two nodes that do have an edge can be retained, ultimately generating the target structure graph.

[0083] Figure 6 A flowchart illustrating a training method for a block diagram generation model according to an embodiment of the present disclosure is shown schematically.

[0084] like Figure 6 As shown, the method includes operations S610 to S650.

[0085] In operation S610, the sample statement corresponding to the sample structure diagram is input into the context encoding sub-model to obtain the sample encoding vector sequence.

[0086] In operation S620, the sample encoding vector sequence is input into the node label generation sub-model to obtain sample node information.

[0087] When operating S630, the sample statement is input into the topology generation sub-model to obtain the sample topology information.

[0088] When operating S640, the sample statement is input into the edge label generation sub-model to obtain the sample edge information.

[0089] In operation with S650, a structure graph generation model is trained based on sample structure graph, sample node information, sample topology information, and sample edge information to obtain the trained structure graph generation model.

[0090] According to embodiments of this disclosure, the structure graph generation model includes a context encoding sub-model, a node label generation sub-model, a topology generation sub-model, and an edge label generation sub-model.

[0091] According to embodiments of this disclosure, the sample structure diagram includes sample node labels, sample topology labels, and sample edge labels.

[0092] According to embodiments of this disclosure, for operation S650, a structure graph generation model is trained based on the sample structure graph, sample node information, sample topology information, and sample edge information to obtain a trained structure graph generation model. This can be achieved using a multi-task learning approach, specifically including: inputting sample node labels and sample node information into a node loss function to obtain node loss values; inputting sample topology labels and sample topology information into a topology loss function to obtain topology loss values; inputting sample edge labels and sample edge information into an edge loss function to obtain edge loss values; weighted summing of the node loss values, topology loss values, and edge loss values ​​to obtain a comprehensive loss value; adjusting the parameters of the structure graph generation model based on the comprehensive loss value until the comprehensive loss value converges; and using the model at which the comprehensive loss value converges as the trained structure graph generation model.

[0093] The training method for the structural graph generation model provided in this disclosure can utilize the correlation between topological information, edge information, and node information to jointly train the context encoding sub-model, node label generation sub-model, topological generation sub-model, and edge label generation sub-model, thereby improving the training speed and the accuracy of the trained structural graph generation model.

[0094] Figure 7 A flowchart illustrating a map generation method according to an embodiment of the present disclosure is shown schematically.

[0095] like Figure 7 As shown, the method includes operation S710.

[0096] When operating the S710, the target map is generated based on the structure diagram. The structure diagram is generated using a structure diagram generation method.

[0097] According to embodiments of this disclosure, generating a target graph based on a structure graph may further include: combining multiple nodes in the structure graph based on topological and edge information to generate a phrase structure graph; and extracting information from the phrase structure graph to generate the target graph.

[0098] According to embodiments of this disclosure, the target graph may include one or more of a knowledge graph and a reasoning graph.

[0099] According to embodiments of this disclosure, a combination model can be used to combine nodes in a structure graph to generate a phrase structure graph. The combination model can include a deep learning model, as long as it is capable of processing the structure graph to generate a phrase structure graph. However, it is not limited to this. Alternatively, some nodes in the structure graph can be merged according to rules to form phrase nodes, thereby obtaining a phrase structure graph.

[0100] According to embodiments of this disclosure, an information extractor can be used to extract information from a phrase structure graph to generate a target graph. The information extractor may include a deep learning model, as long as it is a deep learning model capable of processing phrase structure graphs to generate target graphs.

[0101] According to embodiments of this disclosure, a target graph is generated using a structure graph. Applied to the field of information extraction technology, this method can supplement the content of a knowledge graph during its construction, thereby enhancing its richness. Furthermore, it can improve the ability to identify the relationships between multiple events during the construction of an event graph.

[0102] In summary, the structure diagram generation method provided in this disclosure can quickly and accurately process statements from different domains and generate structure diagrams. Applying structure diagrams to the field of graph generation improves the generation speed of graphs in new domains.

[0103] Figure 8 A block diagram of a structural diagram generation apparatus according to an embodiment of the present disclosure is shown schematically.

[0104] like Figure 8 As shown, the structure diagram generation device 800 may include an encoding module 810, a determination module 820, and a structure diagram generation module 830.

[0105] The encoding module 810 is used to perform context encoding on the statement to be processed to obtain an encoding vector sequence.

[0106] The determination module 820 is used to determine, based on the encoded vector sequence, node information, topological information, and edge information for generating the structure graph. Node information is used to characterize the attribute information of the nodes in the structure graph, topological information is used to characterize whether there are edges between multiple nodes, and edge information is used to characterize the association relationships between multiple nodes.

[0107] The structure graph generation module 830 is used to generate a target structure graph for the statement to be processed based on node information, topology information and edge information.

[0108] According to embodiments of this disclosure, the determining module may include a first transformation unit, a second transformation unit, a first determining unit, a second determining unit, and a third determining unit.

[0109] The first transformation unit is used to perform a first transformation on the encoded vector sequence to obtain a topological structure representation.

[0110] The second transformation unit is used to perform a second transformation on the encoded vector sequence to obtain a relational representation.

[0111] The first determining unit is used to determine node information based on the encoded vector sequence.

[0112] The second determining unit is used to determine the topology information based on the topology representation.

[0113] The third determining unit is used to determine edge information based on relation representation.

[0114] According to embodiments of this disclosure, the statement to be processed includes multiple nodes, and the encoded vector sequence includes multiple encoded vectors, with each node corresponding one-to-one with one of the multiple encoded vectors.

[0115] According to embodiments of this disclosure, the first transformation unit may include a first determining subunit and a first transformation subunit.

[0116] The first determining subunit is used to determine the corresponding encoding vector pair from the encoding vector sequence for any two nodes in the statement to be processed.

[0117] The first transformation subunit is used to perform a first transformation on the coded vector pair to obtain a topological representation of the relationship between the two nodes.

[0118] According to embodiments of this disclosure, the second transformation unit may include a second determining subunit and a second transformation subunit.

[0119] The second determining subunit is used to determine the corresponding encoding vector pair from the encoding vector sequence for any two nodes in the statement to be processed.

[0120] The second transformation subunit is used to perform a second transformation on the encoded vector pair based on the number of categories of edge information, so as to obtain a representation of the relationship between the two nodes.

[0121] According to embodiments of this disclosure, the first determining unit includes an attribute processing subunit.

[0122] The attribute processing subunit is used to determine node information by processing the node attributes of the encoded vector sequence.

[0123] According to embodiments of this disclosure, the node information includes at least one of the following: node part-of-speech information and derived node information used to characterize whether a derived node is generated.

[0124] Figure 9 A block diagram of a training apparatus for generating a model from a structural diagram according to an embodiment of the present disclosure is shown schematically.

[0125] like Figure 9 As shown, the training device 900 for the structure diagram generation model may include a first input module 910, a second input module 920, a third input module 930, a fourth input module 940, and a training module 950.

[0126] The first input module 910 is used to input the sample statements corresponding to the sample structure graph into the context encoding sub-model to obtain a sample encoding vector sequence. The sample structure graph includes sample node labels, sample topology labels, and sample edge labels. The structure graph generation model includes a context encoding sub-model, a node label generation sub-model, a topology generation sub-model, and an edge label generation sub-model.

[0127] The second input module 920 is used to input the sample encoding vector sequence into the node label generation sub-model to obtain sample node information.

[0128] The third input module 930 is used to input sample statements into the topology generation sub-model to obtain sample topology information.

[0129] The fourth input module 940 is used to input sample statements into the edge label generation sub-model to obtain sample edge information.

[0130] Training module 950 is used to train the structure graph generation model based on the sample structure graph, sample node information, sample topology information and sample edge information, and obtain the trained structure graph generation model.

[0131] Figure 10 A block diagram of a map generation apparatus according to an embodiment of the present disclosure is shown schematically.

[0132] like Figure 10 As shown, the map generation device 10 may include a map generation module 1010.

[0133] The atlas generation module 1010 is used to generate the target atlas based on the structure diagram. The structure diagram is generated using a structure diagram generation device.

[0134] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0135] According to an embodiment of the present disclosure, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a method as described in the embodiments of the present disclosure.

[0136] According to embodiments of the present disclosure, a non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions are used to cause a computer to perform methods as described in embodiments of the present disclosure.

[0137] According to embodiments of the present disclosure, a computer program product includes a computer program that, when executed by a processor, implements the methods as described in embodiments of the present disclosure.

[0138] Figure 11 A schematic block diagram of an example electronic device 1100 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0139] like Figure 11 As shown, device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 1102 or a computer program loaded from storage unit 1108 into random access memory (RAM) 1103. The RAM 1103 may also store various programs and data required for the operation of device 1100. The computing unit 1101, ROM 1102, and RAM 1103 are interconnected via bus 1104. Input / output (I / O) interface 1105 is also connected to bus 1104.

[0140] Multiple components in device 1100 are connected to I / O interface 1105, including: input unit 1106, such as keyboard, mouse, etc.; output unit 1107, such as various types of monitors, speakers, etc.; storage unit 1108, such as disk, optical disk, etc.; and communication unit 1109, such as network card, modem, wireless transceiver, etc. Communication unit 1109 allows device 1100 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0141] The computing unit 1101 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1101 performs the various methods and processes described above, such as block diagram generation methods, block diagram generation model training methods, or graph generation methods. For example, in some embodiments, the block diagram generation method, the block diagram generation model training method, or the graph generation method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1108. In some embodiments, part or all of the computer program can be loaded and / or installed on device 1100 via ROM 1102 and / or communication unit 1109. When the computer program is loaded into RAM 1103 and executed by computing unit 1101, one or more steps of the structure graph generation method, structure graph generation model training method, or graph generation method described above can be performed. Alternatively, in other embodiments, computing unit 1101 can be configured to perform the structure graph generation method, structure graph generation model training method, or graph generation method by any other suitable means (e.g., by means of firmware).

[0142] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0143] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0144] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0145] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0146] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0147] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, distributed system servers, or servers incorporating blockchain technology.

[0148] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0149] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for generating a structure diagram, comprising: The statement to be processed is context-encoded to obtain an encoding vector sequence, wherein the statement to be processed is split into multiple single texts at the character level; Based on the encoded vector sequence, node information, topology information, and edge information for generating the structure graph are determined, wherein each single text in the statement to be processed is a byte point, the node information includes derived node information for characterizing whether derived nodes are generated, the topology information is used to characterize whether there are edges between the multiple byte points, and the edge information is used to characterize the association relationship between the multiple byte points. Based on the node information, the topology information, and the edge information, a word-level target structure graph is generated for the statement to be processed. If the node information includes information for representing the generation of derived nodes from the byte point, then a derived node that is associated with the byte point is generated. When the edge information represents a combined association between two byte points, the two byte points are combined; and Based on the derived nodes, combined nodes, and the remaining byte points in the word-level target structure graph, a phrase structure graph is generated. The phrase structure graph is used to transform the graph to obtain a knowledge graph or a reasoning graph.

2. The method according to claim 1, wherein, The step of determining the node information, topological structure information, and edge information for generating the structure graph based on the encoded vector sequence includes: The encoded vector sequence is subjected to a first transformation process to obtain a topological structure representation; The encoded vector sequence is subjected to a second transformation to obtain a relational representation; The node information is determined based on the encoded vector sequence; Based on the topology representation, the topology information is determined; and The edge information is determined based on the relationship representation.

3. The method according to claim 2, wherein, The statement to be processed includes multiple byte points, and the encoding vector sequence includes multiple encoding vectors, with each byte point corresponding to one of the multiple encoding vectors; The first transformation process performed on the encoded vector sequence to obtain the topological structure representation includes: For any two byte points in the statement to be processed, determine the encoding vector pair corresponding to the two byte points from the encoding vector sequence; as well as The encoded vector pair is subjected to a first transformation process to obtain a topological representation of the relationship between the two byte points.

4. The method according to claim 2 or 3, wherein, The statement to be processed includes multiple byte points, and the encoding vector sequence includes multiple encoding vectors, with each byte point corresponding to one of the multiple encoding vectors; The second transformation process on the encoded vector sequence to obtain the relational representation includes: For any two byte points in the statement to be processed, determine the encoding vector pair corresponding to the two byte points from the encoding vector sequence; as well as Based on the number of categories of edge information, a second transformation process is performed on the encoded vector pair to obtain a representation of the relationship between the two byte points.

5. The method according to claim 4, wherein, Determining the node information based on the encoded vector sequence includes: The node information is determined by processing the node attributes of the encoded vector sequence; The node information also includes node part-of-speech information.

6. A training method for a structure graph generation model, wherein, The structure graph generation model includes a context encoding sub-model, a node label generation sub-model, a topology generation sub-model, and an edge label generation sub-model. The training method for the structure graph generation model includes: The sample statement corresponding to the sample structure graph is input into the context encoding sub-model to obtain the sample encoding vector sequence, wherein the sample structure graph includes sample node labels, sample topology labels and sample edge labels; The sample encoding vector sequence is input into the node label generation sub-model to obtain sample node information; The sample statement is input into the topology generation sub-model to obtain sample topology information; The sample statement is input into the edge label generation sub-model to obtain sample edge information; and Based on the sample structure graph, the sample node information, the sample topology information, and the sample edge information, the structure graph generation model is trained to obtain the trained structure graph generation model; The structure diagram generation model is used to process the statement to be processed and generate a character-level target structure diagram for the statement to be processed. The statement to be processed is split into multiple single texts at the character level. The character-level target structure graph is generated based on node information, topology information, and edge information. Each single text in the statement to be processed is a byte point. The node information includes derived node information used to characterize whether derived nodes are generated. The topology information is used to characterize whether there are edges between multiple byte points. The edge information is used to characterize the association relationship between multiple byte points. The character-level target structure diagram is used to generate a phrase structure diagram; The operations for generating the phrase structure graph include: If the node information includes information for representing the generation of derived nodes from the byte point, then a derived node that is associated with the byte point is generated. When the edge information represents a combined association between two byte points, the two byte points are combined; and Based on the derived nodes, combined nodes, and the remaining byte points in the word-level target structure graph, a phrase structure graph is generated. The phrase structure graph is used to transform the graph to obtain a knowledge graph or a reasoning graph.

7. A method for generating a map, comprising: Target map generation based on structure graph. The structure diagram is generated using the structure diagram generation method according to any one of claims 1 to 5.

8. A structural diagram generation apparatus, comprising: The encoding module is used to perform context encoding on the statement to be processed to obtain an encoding vector sequence, wherein the statement to be processed is split into multiple single texts at the character level; The determining module is configured to determine, based on the encoded vector sequence, node information, topological structure information, and edge information for generating a structural graph, wherein each single text in the statement to be processed is a byte point, the node information includes derived node information for indicating whether derived nodes are generated, the topological structure information is used to indicate whether edges exist between the multiple byte points, and the edge information is used to indicate the association relationships between the multiple byte points; and The structure graph generation module is used to generate a word-level target structure graph for the statement to be processed based on the node information, the topology information, and the edge information. The structural diagram generation device is further used for: If the node information includes information for representing the generation of derived nodes from the byte point, then a derived node that is associated with the byte point is generated. When the edge information represents a combined association between two byte points, the two byte points are combined; and Based on the derived nodes, combined nodes, and the remaining byte points in the word-level target structure graph, a phrase structure graph is generated. The phrase structure graph is used to transform the graph to obtain a knowledge graph or a reasoning graph.

9. The apparatus according to claim 8, wherein, The determining module includes: The first transformation unit is used to perform a first transformation process on the encoded vector sequence to obtain a topological structure representation; The second transformation unit is used to perform a second transformation process on the encoded vector sequence to obtain a relational representation; The first determining unit is configured to determine the node information based on the encoded vector sequence; The second determining unit is configured to determine the topology information based on the topology representation; and The third determining unit is used to determine the edge information based on the relation representation.

10. The apparatus according to claim 9, wherein, The statement to be processed includes multiple byte points, and the encoding vector sequence includes multiple encoding vectors, with each byte point corresponding to one of the multiple encoding vectors; The first transformation unit includes: The first determining subunit is used to determine, for any two byte points in the statement to be processed, a pair of encoding vectors corresponding to the two byte points from the encoding vector sequence; as well as The first transformation subunit is used to perform a first transformation process on the encoded vector pair to obtain a topological representation of the relationship between the two byte points.

11. The apparatus according to claim 9 or 10, wherein, The statement to be processed includes multiple byte points, and the encoding vector sequence includes multiple encoding vectors, with each byte point corresponding to one of the multiple encoding vectors; The second transformation unit includes: The second determining subunit is used to determine, for any two byte points in the statement to be processed, the encoding vector pair corresponding to the two byte points from the encoding vector sequence; as well as The second transformation subunit is used to perform a second transformation process on the encoded vector pair based on the number of categories of the edge information to obtain a representation of the relationship between the two byte points.

12. The apparatus according to claim 11, wherein, The first determining unit includes: An attribute processing subunit is used to determine the node information by performing node attribute processing on the encoded vector sequence; The node information also includes node part-of-speech information.

13. A training device for a structure graph generation model, wherein, The structure graph generation model includes a context encoding sub-model, a node label generation sub-model, a topology generation sub-model, and an edge label generation sub-model. The training device for the structure graph generation model includes: The first input module is used to input the sample statement corresponding to the sample structure diagram into the context encoding sub-model to obtain the sample encoding vector sequence, wherein the sample structure diagram includes sample node labels, sample topology labels and sample edge labels; The second input module is used to input the sample encoding vector sequence into the node label generation sub-model to obtain sample node information; The third input module is used to input the sample statement into the topology generation sub-model to obtain sample topology information; The fourth input module is used to input the sample statement into the edge label generation sub-model to obtain sample edge information; and The training module is used to train the structure graph generation model based on the sample structure graph, the sample node information, the sample topology information, and the sample edge information, so as to obtain the trained structure graph generation model. The structure graph generation model is used to process the statement to be processed, generating a character-level target structure graph for the statement to be processed. The statement to be processed is split into multiple single texts at the character level. The character-level target structure graph is generated based on node information, topology information, and edge information. Each single text in the statement to be processed is a byte point. The node information includes derived node information used to characterize whether derived nodes are generated. The topology information is used to characterize whether there are edges between multiple byte points. The edge information is used to characterize the association relationship between multiple byte points. The character-level target structure diagram is used to generate a phrase structure diagram; The operations for generating the phrase structure graph include: If the node information includes information for representing the generation of derived nodes from the byte point, then a derived node that is associated with the byte point is generated. When the edge information represents a combined association between two byte points, the two byte points are combined; and Based on the derived nodes, combined nodes, and the remaining byte points in the word-level target structure graph, a phrase structure graph is generated. The phrase structure graph is used to transform the graph to obtain a knowledge graph or a reasoning graph.

14. A map generation apparatus, comprising: The map generation module is used to generate target maps based on structure maps. The structural diagram is generated using the structural diagram generation apparatus according to any one of claims 8 to 12.

15. An electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the structure graph generation method of any one of claims 1 to 5, the training method of the structure graph generation model of claim 6, or the graph generation method of claim 7.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to execute the structural diagram generation method according to any one of claims 1 to 5, the training method of the structural diagram generation model according to claim 6, or the graph generation method according to claim 7.

17. A computer program product comprising a computer program that, when executed by a processor, implements the structural graph generation method according to any one of claims 1 to 5, the training method for the structural graph generation model according to claim 6, or the graph generation method according to claim 7.

Citation Information

Patent Citations

  • Knowledge graph construction method and device, electronic equipment and storage medium

    CN111177393A