Method and apparatus for capturing knowledge representation of knowledge graph hierarchy
By acquiring the initial data of knowledge graph triples and determining the complex vector data, the problem of being unable to capture hierarchical structure in existing technologies is solved by using the predicted modulus and angle data, thus achieving efficient knowledge representation and training.
Patent Information
- Application Number
- CN202210459102.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-27
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2042-04-27
AI Technical Summary
Existing knowledge representation methods cannot effectively capture the hierarchical structure information of knowledge graphs and are difficult to reason about the relationships between different patterns.
By acquiring the initial data of knowledge graph triples, we determine the complex vector data, including the magnitude and angle data of the head entity, tail entity, and relationship. We then use the predicted magnitude and angle data to determine the representation data of the tail entity and train the system by sharing relationship parameters among multiple sub-entity data.
It achieves effective capture of the hierarchical structure of knowledge graphs, improves the accuracy of knowledge representation and training efficiency, and can automatically capture the hierarchical structure in knowledge graphs.
Smart Images

Figure CN117009535B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the field of deep learning and knowledge graph, and in particular to a knowledge representation method and device for capturing knowledge graph hierarchy. BACKGROUND
[0002] A knowledge graph (KG) is a multi-relation graph composed of entities and relations. In a knowledge graph, a relation is usually represented as an edge, and each edge and the two entities connected by the edge are represented as a triple, i.e., a head entity, a relation, and a tail entity, also known as a fact. Each triple represents that two entities are connected by a specific relation. The key idea of knowledge representation learning is to embed the components of a knowledge graph, including entities and relations, into a continuous vector space. These entity and relation embedding representations can be further used for various tasks.
[0003] Knowledge representation methods include a Translating Embedding (TransE) based method, a semantic similarity matching based method, and a neural network based method. Although the above knowledge representation methods can represent structured data, the latent symbolic nature of such triples limits further operations on the knowledge graph. In addition, the above knowledge representation methods cannot effectively reason about different patterns of relations, and without additional information, they cannot effectively obtain the hierarchical information of the knowledge graph. SUMMARY
[0004] In view of the above problems, the present disclosure provides a knowledge representation method and device for capturing knowledge graph hierarchy information.
[0005] According to a first aspect of the present disclosure, a knowledge representation method for capturing knowledge graph hierarchy is provided, comprising: obtaining initial data of a knowledge graph triple, the knowledge graph triple comprising a head entity, a tail entity, and an associated relation between the head entity and the tail entity; determining complex vector data of the knowledge graph triple based on the initial data of the knowledge graph triple, the complex vector data comprising head entity data, tail entity data, and modulus data and angle data of the associated relation between the head entity and the tail entity; determining predicted tail entity data based on the head entity data, the modulus data, and the angle data; and determining representation data of the tail entity based on the tail entity data and the predicted tail entity data, the representation data being used to represent the knowledge graph hierarchy.
[0006] In an embodiment according to the present disclosure, the predicted tail entity data comprises predicted length data and predicted angle data; and the determining the predicted tail entity data according to the head entity data, the length data, and the angle data comprises: determining the predicted length data from the head entity to the tail entity according to the head entity data and the length data; and determining the predicted angle data from the head entity to the tail entity according to the head entity data and the angle correlation data.
[0007] In an embodiment according to the present disclosure, the determining the representation data of the tail entity according to the tail entity data and the predicted tail entity data comprises: determining length difference data according to the predicted length data and the tail entity data; determining angle difference data according to the predicted angle data and the tail entity data; and determining the representation data of the tail entity according to the length difference data and the angle difference data.
[0008] In an embodiment according to the present disclosure, the head entity data and the tail entity data are represented by a plurality of sub-entity data.
[0009] In an embodiment according to the present disclosure, the head entity data, the length data, and the angle data are input into a prediction module of a knowledge representation model of the knowledge graph hierarchical structure, and the prediction module outputs the predicted tail entity data.
[0010] In an embodiment according to the present disclosure, in the process of training the knowledge representation model of the knowledge graph hierarchical structure, the plurality of sub-entity data share the same relationship parameter.
[0011] According to a second aspect of the present disclosure, a knowledge representation apparatus for capturing a knowledge graph hierarchical structure is provided, comprising: an acquisition module configured to acquire initial data of a knowledge graph triple, the knowledge graph triple comprising a head entity, a tail entity, and a correlation relationship between the head entity and the tail entity; a first determination module configured to determine complex vector data of the knowledge graph triple according to the initial data of the knowledge graph triple, the complex vector data comprising head entity data, tail entity data, length data of the correlation relationship between the head entity and the tail entity, and angle data of the correlation relationship between the head entity and the tail entity; a second determination module configured to determine predicted tail entity data according to the head entity data, the length data, and the angle data; and a knowledge representation module configured to determine representation data of the tail entity according to the tail entity data and the predicted tail entity data, the representation data being used to represent the knowledge graph hierarchical structure.
[0012] According to a third aspect of the present disclosure, an electronic device is provided, comprising: one or more processors; and a memory storing one or more instructions, wherein when the one or more instructions are executed by the one or more processors, the one or more processors implement the above-described knowledge representation method for capturing a knowledge graph hierarchical structure.
[0013] According to a fourth aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to implement the method for capturing knowledge representation of knowledge graph hierarchy as described above.
[0014] According to a fifth aspect of the present disclosure, there is provided a computer program product comprising computer executable instructions for implementing the method for capturing knowledge representation of knowledge graph hierarchy as described above when executed by a processor. BRIEF DESCRIPTION OF DRAWINGS
[0015] The above and other objects, features and advantages of the present disclosure will become more apparent from the following description when taken in conjunction with the accompanying drawings, in which:
[0016] Figure 1 A schematic diagram of a system architecture of the method for capturing knowledge representation of knowledge graph hierarchy according to an embodiment of the present disclosure is shown;
[0017] Figure 2 A flowchart of the method for capturing knowledge representation of knowledge graph hierarchy according to an embodiment of the present disclosure is shown;
[0018] Figure 3 A schematic diagram of initial data of knowledge graph triples according to an embodiment of the present disclosure is shown;
[0019] Figure 4 A schematic diagram of complex vector data of knowledge graph triples according to an embodiment of the present disclosure is shown;
[0020] Figure 5 A schematic diagram of determining representation data of tail entities according to an embodiment of the present disclosure is shown;
[0021] Figure 6 A schematic diagram of the method for capturing knowledge representation of knowledge graph hierarchy according to an embodiment of the present disclosure is shown;
[0022] Figure 7 A block diagram of a structure of the apparatus for capturing knowledge representation of knowledge graph hierarchy according to an embodiment of the present disclosure is shown; and
[0023] Figure 8 A block diagram of an electronic device suitable for the method for capturing knowledge representation of knowledge graph hierarchy according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0024] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood, however, that the description is merely exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description of the embodiments of the present disclosure, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure. However, it would be apparent to one skilled in the art that the present disclosure can be practiced without these specific details. In other instances, well-known structures and functions have been described in detail in order to avoid obscuring the concepts of the present disclosure.
[0025] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the present disclosure. As used herein, the term "includes" and tautological expressions thereof, such as "including," "includes," "include," "contains," "containing," and so on, mean the term "comprises," unless otherwise noted.
[0026] All terms used herein (including technical and scientific terms) have the meanings commonly understood by one of ordinary skill in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having meanings that are consistent with the context of the specification, and should not be interpreted in an idealized or overly formal manner.
[0027] In the case of using expressions similar to "at least one of A, B, and C, etc.", it should generally be interpreted to include any of them alone, any combination of two or more of them, as well as the case in which all of them are included, unless otherwise noted.
[0028] Embodiments of the present disclosure provide a method for capturing a knowledge representation of a knowledge graph hierarchy, including: obtaining initial data of a knowledge graph triple, the knowledge graph triple including a head entity, a tail entity, and a relationship between the head entity and the tail entity; determining complex vector data of the knowledge graph triple according to the initial data of the knowledge graph triple, the complex vector data including head entity data, tail entity data, and modulus data and angle data of the relationship between the head entity and the tail entity; determining predicted tail entity data according to the head entity data, the modulus data, and the angle data; and determining representation data of the tail entity according to the tail entity data and the predicted tail entity data, the representation data being used to represent the knowledge graph hierarchy.
[0029] Figure 1 The system architecture of the method for capturing a knowledge representation of a knowledge graph hierarchy according to embodiments of the present disclosure is schematically shown.
[0030] As Figure 1As shown, the system architecture 100 according to this embodiment can include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is a medium for providing a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 can include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0031] A user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various applications can be installed on the terminal devices 101, 102, 103.
[0032] The terminal devices 101, 102, 103 can be various electronic devices with a display screen and supporting web browsing, including but not limited to smartphones, tablet computers, laptop computers, desktop computers, etc.
[0033] The server 105 can be a server providing various services, such as a background management server providing support for a website browsed by a user using the terminal devices 101, 102, 103 (only as an example). The background management server can analyze and process received user requests and other data, and feed back the processing results (such as a webpage, information, or data, etc. obtained or generated according to a user request) to the terminal devices.
[0034] It should be noted that the method for capturing the knowledge representation of the knowledge graph hierarchical structure provided by the embodiments of the present disclosure can generally be executed by the server 105. Correspondingly, the apparatus for capturing the knowledge representation of the knowledge graph hierarchical structure provided by the embodiments of the present disclosure can generally be arranged in the server 105. The method for capturing the knowledge representation of the knowledge graph hierarchical structure provided by the embodiments of the present disclosure can also be executed by a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and / or the server 105. Correspondingly, the apparatus for capturing the knowledge representation of the knowledge graph hierarchical structure provided by the embodiments of the present disclosure can also be arranged in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and / or the server 105.
[0035] It should be understood that Figure 1 The number of terminal devices, networks, and servers in the system architecture is only illustrative. According to the needs of implementation, there can be any number of terminal devices, networks, and servers.
[0036] The method of the disclosed embodiments will be described in detail below based on the system architecture described above. Figure 1 The method of the disclosed embodiments will be described in detail below based on the system architecture described above. Figures 2 to 6 The method of the disclosed embodiments will be described in detail below based on the system architecture described above.
[0037] Figure 2A flowchart of a method for capturing a knowledge representation of a knowledge graph hierarchy is shown schematically.
[0038] As shown in Figure 2 The method includes operations S210-S240.
[0039] In operation S210, initial data of a knowledge graph triple is obtained.
[0040] According to embodiments of the present disclosure, for a knowledge graph that needs to be represented, initial data of a plurality of triples in the knowledge graph is obtained. The knowledge graph triple includes a head entity, a tail entity, and an association relationship between the head entity and the tail entity. Specifically, the initial data of the triple includes triple data in the form of a graph and triple data in the form of a real vector. For example, for the triple (singer Wang, born in, J city), the obtained initial data includes graph data or real vector data about the entities "singer Wang" and "J city" and the relationship "born in".
[0041] In operation S220, complex vector data of the knowledge graph triple is determined according to the initial data of the knowledge graph triple, the complex vector data including head entity data, tail entity data, and modulus data and angle data of the association relationship between the head entity and the tail entity.
[0042] According to embodiments of the present disclosure, complex vector data of the knowledge graph triple is determined according to the initial data of the knowledge graph triple. Specifically, the knowledge representation model for capturing the hierarchical structure of the knowledge graph includes a data conversion module, a prediction module, and a knowledge representation module. The initial data of the knowledge graph triple can be input into the pre-trained knowledge representation model for capturing the hierarchical structure of the knowledge graph, and the complex vector data is output by the data conversion module of the model. The complex vector data includes converted head entity data, tail entity data, and complex vector data of the association relationship between the head entity and the tail entity.
[0043] According to embodiments of the present disclosure, the head entity data and the tail entity data are complex vector data including both real numbers and complex numbers, and the association relationship between the head entity and the tail entity includes complex vector data in the form of modulus and angle. For example, the vector representation form of the head entity data and the tail entity data is x+iy, x represents a real number, and iy represents a complex number. The angle data of the association relationship between the head entity and the tail entity is cos z+i sinz, z represents an angle, and w represents the modulus data of the association relationship.
[0044] For example, for the input triple (singer Wang, born in, J city), the initial data of the triple is input into the data conversion module, and the converted complex vector data is output, and the representation form includes (h, r, t). Through data conversion, two entities and relationships are mapped to h, r, t, h represents the head entity, t represents the tail entity, and r represents the association relationship between the head entity and the tail entity. The output (h, r, t) can all be mapped in the complex vector space.
[0045] In operation S230, the predicted tail entity data is determined according to the head entity data, the module length data, and the angle data.
[0046] According to an embodiment of the present disclosure, after obtaining the head entity data in the form of a complex vector, the module length data and the angle data of the association relationship between the head entity and the tail entity, the predicted tail entity data can be obtained through calculation according to the head entity data, and the module length data and the angle data of the association relationship.
[0047] According to an embodiment of the present disclosure, the predicted tail entity data includes predicted module length data and predicted angle data. Determining the predicted tail entity data includes: determining the predicted module length data from the head entity to the tail entity according to the head entity data and the module length data of the association relationship. The predicted angle data from the head entity to the tail entity is determined according to the head entity data and the angle association relationship data.
[0048] In operation S240, the representation data of the tail entity is determined according to the tail entity data and the predicted tail entity data, and the representation data is used to represent the hierarchical structure of the knowledge graph.
[0049] According to an embodiment of the present disclosure, the representation data of the tail entity in the current knowledge graph triple is determined according to the difference between the tail entity data and the predicted tail entity data. After obtaining the representation data of the tail entity in the plurality of triples of the knowledge graph, the representation data can be used as the attribute data of the entity in the knowledge graph. Through the knowledge representation method of the present disclosure, the representation data of the entity in the knowledge graph can be determined, and the hierarchical structure information of the current knowledge graph can be captured through the representation data of the entity.
[0050] Specifically, the current knowledge graph includes multiple triple data (singer Wang, born in, J city), (singer Wang, traveled, country M), (actor Zhang, husband and wife, singer Wang), and the like. By analyzing the multiple triple data, the representation data of the entities in the knowledge graph can be obtained. For example, after calculation, the representation data of the entity "singer Wang" is a numerical value A, the representation data of the entity "actor Zhang" is a numerical value B, and the representation data of the entity "J city" is a numerical value C. In the case where the numerical value A and the numerical value B both satisfy the same preset interval, the entities "singer Wang" and "actor Zhang" have the same hierarchical structure in the knowledge graph; in the case where the numerical value A satisfies a first preset interval and the numerical value C satisfies a second preset interval, the entities "singer Wang" and "J city" have different hierarchical structures in the knowledge graph. According to actual conditions, the hierarchical structure of the entity "singer Wang" can be higher than or lower than that of the entity "J city".
[0051] The knowledge representation method adopted by the present disclosure can model different modes of relationships. At the same time, by using the angle conversion and module length conversion of the correlation between entities, not only can the problem of low extraction accuracy existing in the existing knowledge representation method be solved, but also the hierarchical structure in the knowledge graph can be automatically captured. In addition, the method for representing multiple entities by using multiple sub-entity data adopted by the present disclosure reduces the parameters of relationship embedding through a parameter sharing mechanism, reduces the training difficulty, and improves the training efficiency.
[0052] Figure 3 An illustrative diagram of initial data of a knowledge graph triple according to an embodiment of the present disclosure is shown.
[0053] As shown in Figure 3 , the knowledge graph includes three triples (h'1, r1, t'1), (h'1, r2, t'2), and (h'1, r3, t'3), where h'1 represents the initial data of the head entity "singer Wang", t'1 represents the initial data of the tail entity "actor Zhang", t'2 represents the initial data of the tail entity "J city", and t'3 represents the initial data of the tail entity "country M". r1 represents the relationship between the head entity "singer Wang" and the tail entity "actor Zhang", which can be "husband and wife"; r2 represents the relationship between the head entity "singer Wang" and the tail entity "J city", which can be "born in"; and r3 represents the relationship between the head entity "singer Wang" and the tail entity "country M", which can be "traveled".
[0054] Figure 4 An illustrative diagram of complex vector data of a knowledge graph triple according to an embodiment of the present disclosure is shown.
[0055] As shown in Figure 4As shown, after the initial data of the knowledge graph triple is input into the data conversion module, the complex vector data of the knowledge graph triple is output. The complex vector data output by the data conversion module can be mapped into a complex vector space. The complex vector data obtained after conversion of the head entity "singer Wang" is h1, the complex vector data obtained after conversion of the tail entity "actor Zhang" is t1, the complex vector data obtained after conversion of the tail entity "J city" is t2, and the complex vector data obtained after conversion of the tail entity "country M" is t3.
[0056] According to an embodiment of the present disclosure, after predicting the tail entity data, according to the tail entity data and the predicted tail entity data, the representation data of the tail entity can be determined. Specifically, according to the head entity data, the predicted modulus data is obtained after the modulus change multiple of the relationship, the distance between the predicted modulus data and the modulus of the tail entity is calculated, and the modulus difference data is determined.
[0057] According to an embodiment of the present disclosure, the calculation formula of the modulus difference data satisfies:
[0058] d m =‖t-w*h‖2 (1)
[0059] wherein d m represents the modulus difference data, h represents the head entity, t represents the tail entity, w represents the modulus data of the association relationship between the head entity h and the tail entity t, w*h represents the product of the modulus of the association relationship and the modulus of the head entity, and ‖t-w*h‖2 represents the two norm of the distance between the tail entity and the head entity after conversion.
[0060] According to the head entity data, the predicted angle data is obtained after the angle change multiple of the association relationship, the distance between the predicted angle data and the angle of the tail entity is calculated, and the angle difference data is determined. The calculation formula of the angle difference data satisfies:
[0061] d p =‖t-h·r‖2 (2)
[0062] wherein d p represents the angle difference data, h represents the head entity, t represents the tail entity, r represents the association relationship between the head entity h and the tail entity t, the modulus of r is 1 at this time, · represents Hadamard product, so the modulus of h will not change after Hadamard product between h and r. ‖t-h·r‖2 represents the two norm of t-h·r.
[0063] According to an embodiment of the present disclosure, according to the modulus difference data and the angle difference data of the tail entity, the representation data of the tail entity can be determined. The calculation formula of the representation data satisfies:
[0064] f=-(d m +d p) (3)
[0065] wherein f is the representation data of the tail entity, d m represents the module length difference data, d p represents the angle difference data.
[0066] According to an embodiment of the present disclosure, as shown in the following table, take the triplet (singer Wang, born in, J city) as an example. After data conversion, in the complex vector space, (h′1, r2, t′2) is converted into (h1, r2, t2). The head entity “singer Wang” is h1, the tail entity “J city” is t2, the association relationship “born in” is r2, and the module length of the association relationship is w2. Figure 3
[0067] Figure 5 A schematic diagram illustrating determination of the representation data of the tail entity according to an embodiment of the present disclosure is shown.
[0068] As shown in the following table, the predicted tail entity data w2h1r2 can be obtained. r2 represents the angle data of the relationship r2. The module length of the difference between the predicted tail entity data and the tail entity data is |w2h1r2-t2|. That is, the representation data of the tail entity t2 is represented as |w2h1r2-t2| in the complex vector space. Figure 5 According to an embodiment of the present disclosure, the head entity data and the tail entity data can also be represented by a plurality of sub-entity data. For example, the head entity data h′1 is represented by m sub-entity data {e1, e2, …, em}. At this time, the head entity data h′1 can be determined by the association relationship between the m sub-entity data. m
[0069]
[0070] According to an embodiment of the present disclosure, the data conversion module of the knowledge representation model capturing the hierarchical structure of the knowledge graph can be used to convert the entity and the relationship by uniform distribution, to obtain the m sub-entity data.
[0071] According to an embodiment of the present disclosure, the head entity data, the module length data, and the angle data can be input into the prediction module of the knowledge representation model capturing the hierarchical structure of the knowledge graph, to output the predicted tail entity data.
[0072] According to an embodiment of the present disclosure, a prediction module of a knowledge representation model capturing a knowledge graph hierarchical structure is used to output predicted tail entity data. In the process of training the knowledge representation model capturing the knowledge graph hierarchical structure, by controlling the change multiple of the module length of the association relationship between the head entity and the tail entity, the change of the module length of the head entity to the tail entity is realized; similarly, by controlling the change multiple of the angle of the association relationship between the head entity and the tail entity, the change of the angle of the head entity to the tail entity is realized. In the training process, the tail entity data is taken as a label, the difference between the predicted tail entity data and the tail entity data is taken as a training parameter, and the knowledge representation model capturing the knowledge graph hierarchical structure is trained. The higher the score of the triple is, the closer the predicted tail entity data is to the correct tail entity. After the head entity data, the module length data, and the angle data are input into the prediction module, the output predicted tail entity data is the predicted tail entity data closest to the tail entity data.
[0073] According to an embodiment of the present disclosure, in the case of representing the head entity data and the tail entity data by using multiple sub-entity data, when training the knowledge representation model capturing the knowledge graph hierarchical structure, since the multiple sub-entity data share the same relationship parameter, the training process will generate fewer training parameters, reduce the training difficulty, and improve the training efficiency.
[0074] Figure 6 A schematic diagram of a knowledge representation method capturing a knowledge graph hierarchical structure according to an embodiment of the present disclosure is schematically shown.
[0075] According to an embodiment of the present disclosure, as shown in Figure 6 In operation S610, the triple of the knowledge graph is input, and the triple is input into the knowledge representation model capturing the knowledge graph hierarchical structure. In operation S620, according to the initial data of the input triple, the complex vector data of the entity and the relationship representation are obtained by using the data conversion module. The head entity data, the module length data, and the angle data are input into the prediction module of the knowledge representation model capturing the knowledge graph hierarchical structure. In operation S630, the module length transformation is performed by using the prediction module, and in operation S640, the angle transformation is performed by using the prediction module, to obtain the predicted tail entity data of the tail entity. In operation S650, the predicted tail entity data and the tail entity data are input into the data representation module, and according to the predicted tail entity data and the tail entity data, the representation data of the tail entity is output. Similarly, the representation data of the tail entity in all triples of the knowledge graph is obtained by using the above method. In operation S660, the knowledge graph hierarchical structure is determined.
[0076] According to an embodiment of the present disclosure, in the case that a node in the knowledge graph is the tail entity of multiple triples, the final representation data of the node can be determined by summing the representation data of the multiple tail entities, and then the representation data of the entire knowledge graph is obtained.
[0077] The knowledge representation method adopted by the present disclosure can capture the hierarchical structure of the knowledge graph and model different modes of relationships. Meanwhile, by using the angle conversion and module length conversion of the correlation between entities, the present disclosure can not only solve the problem of low extraction accuracy existing in the prior art knowledge representation method, but also automatically capture the hierarchical structure in the knowledge graph. In addition, the present disclosure adopts the method of using multiple sub-entity data to represent multiple entity data, reduces the parameters of relationship embedding through the parameter sharing mechanism, reduces the training difficulty, and improves the training efficiency.
[0078] Figure 7 A structural block diagram of a knowledge representation device for capturing the hierarchical structure of the knowledge graph according to an embodiment of the present disclosure is schematically shown.
[0079] As Figure 7 shown, the knowledge representation method device 700 for capturing the hierarchical structure of the knowledge graph according to the embodiment includes an acquisition module 710, a first determination module 720, a second determination module 730, and a knowledge representation module 740.
[0080] The acquisition module 710 is configured to acquire initial data of a knowledge graph triple, the knowledge graph triple including a head entity, a tail entity, and a correlation between the head entity and the tail entity. In an embodiment, the acquisition module 710 can be configured to perform the operation S210 described above, and details are not repeated here.
[0081] The first determination module 720 is configured to determine complex vector data of the knowledge graph triple according to the initial data of the knowledge graph triple, the complex vector data including head entity data, tail entity data, and module length data and angle data of the correlation between the head entity and the tail entity. In an embodiment, the first determination module 720 can be configured to perform the operation S220 described above, and details are not repeated here.
[0082] The second determination module 730 is configured to determine predicted tail entity data according to the head entity data, the module length data, and the angle data. In an embodiment, the second determination module 730 can be configured to perform the operation S230 described above, and details are not repeated here.
[0083] The knowledge representation module 740 is configured to determine representation data of the tail entity according to the tail entity data and the predicted tail entity data, the representation data being used to represent the hierarchical structure of the knowledge graph. In an embodiment, the knowledge representation module 740 can be configured to perform the operation S240 described above, and details are not repeated here.
[0084] Figure 8 A block diagram of an electronic device adapted to the knowledge representation method for capturing the hierarchical structure of the knowledge graph according to an embodiment of the present disclosure is schematically shown.
[0085] As Figure 8As shown, the electronic device 800 according to embodiments of the present disclosure includes a processor 801, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 802 or loaded into a random access memory (RAM) 803 from a storage section 808. The processor 801 can include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor (e.g., an application specific integrated circuit (ASIC)), and so on. The processor 801 can also include an on-board memory for cache use. The processor 801 can include a single processing unit or multiple processing units for performing the various actions of the method processes according to embodiments of the present disclosure.
[0086] In the RAM 803, various programs and data required for the operation of the electronic device 800 are stored. The processor 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. The processor 801 performs various operations of the method processes according to embodiments of the present disclosure by executing the programs in the ROM 802 and / or the RAM 803. Note that the programs can also be stored in one or more memories other than the ROM 802 and the RAM 803. The processor 801 can also perform various operations of the method processes according to embodiments of the present disclosure by executing the programs stored in the one or more memories.
[0087] According to embodiments of the present disclosure, the electronic device 800 can also include an input / output (I / O) interface 805, which is also connected to the bus 804. The electronic device 800 can further include one or more of the following components connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as necessary. A removable recording medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 810 as necessary, so that a computer program read therefrom is installed into the storage section 808 as necessary.
[0088] The present disclosure also provides a computer readable storage medium, which can be included in the device / apparatus / system described in the above embodiments; or can exist separately without being assembled into the device / apparatus / system. The above computer readable storage medium carries one or more programs, which when executed, implement the method according to embodiments of the present disclosure.
[0089] According to an embodiment of the present disclosure, the computer readable storage medium can be a nonvolatile computer readable storage medium, for example, can include but not limited to: a portable computer diskette, a hard disk, a random access memory (RAM), a read only memory (ROM), an erasable programmable read only memory (EPROM or flash memory), a portable compact disc read only memory (CD-ROM), an optical storage device, a magnetic storage device, or any appropriate combination thereof. In the present disclosure, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, the computer readable storage medium can include the ROM 802 and / or the RAM 803 described above and / or one or more memory other than the ROM 802 and the RAM 803.
[0090] Embodiments of the present disclosure also include a computer program product, which includes a computer program containing program codes for executing the methods shown in the flowcharts. When the computer program product is run in a computer system, the program codes are used to make the computer system implement the knowledge representation method for capturing the hierarchical structure of the knowledge graph provided by the embodiments of the present disclosure.
[0091] The above functions defined in the system / device of the embodiments of the present disclosure are performed when the computer program is executed by the processor 801. According to an embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by computer program modules.
[0092] In one embodiment, the computer program can rely on tangible storage media such as optical storage media, magnetic storage media, etc. In another embodiment, the computer program can also be transmitted, distributed, and downloaded in the form of signals on a network medium, and be downloaded and installed through the communication part 809, and / or be installed from the detachable medium 811. The program codes contained in the computer program can be transmitted by any appropriate network medium, including but not limited to: wireless, wired, etc., or any appropriate combination thereof.
[0093] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or be installed from the detachable medium 811. When the computer program is executed by the processor 801, the above functions defined in the system of the embodiments of the present disclosure are performed. According to an embodiment of the present disclosure, the system, device, apparatus, module, unit, etc. described above can be implemented by computer program modules.
[0094] According to embodiments of the present disclosure, program code of the computer programs provided by embodiments of the present disclosure can be written in any combination of one or more programming languages, and specifically, these computer programs can be implemented using a high-level procedural and / or object-oriented programming language, and / or an assembly / machine language. The programming language includes, but is not limited to, a programming language such as Java, C++, Python, "C" language, or a similar programming language. The program code can be executed entirely on a user computing device, partially on a user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case involving a remote computing device, the remote computing device can be connected to the user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, connected through the Internet by using an Internet service provider).
[0095] The flow diagrams and the block diagrams in the drawings are illustrations of possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow diagrams or block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flow diagrams, and combinations thereof, can be implemented by special purpose hardware-based systems that perform the specified functions or operations, or combinations of special purpose hardware and computer instructions.
[0096] Those skilled in the art can understand that the features described in various embodiments of the present disclosure and / or claims can be combined or / and integrated, even if such combinations or integrations are not explicitly described in the present disclosure. In particular, the features described in various embodiments of the present disclosure and / or claims can be combined and / or integrated in various combinations, without departing from the spirit and teachings of the present disclosure. All such combinations and / or integrations are within the scope of the present disclosure.
[0097] The specific embodiments described above are intended to be illustrative of the present disclosure and its best mode known to the inventors at the time of filing the application. It is understood that the present disclosure is not limited to the specific embodiments described above, but includes any and all alternatives falling within the scope of the present disclosure.
Claims
1. A knowledge representation method for capturing the hierarchical structure of a knowledge graph, comprising: Obtain initial data for knowledge graph triples, wherein the knowledge graph triples include a head entity, a tail entity, and the association between the head entity and the tail entity; Based on the initial data of the knowledge graph triples, the complex vector data of the knowledge graph triples is determined. The complex vector data includes head entity data, tail entity data, and the modulus data and angle data of the association relationship between the head entity and the tail entity. Based on the head entity data, the module length data, and the angle data, the predicted tail entity data is determined; as well as Based on the tail entity data and the predicted tail entity data, the representation data of the tail entity is determined, and the representation data is used to represent the hierarchical structure of the knowledge graph; The predicted tail entity data includes predicted modulus data and predicted angle data; The determination of predicted tail entity data based on the head entity data, the modulus data, and the angle data includes: Based on the head entity data and the module length data, determine the predicted module length data from the head entity to the tail entity; and Based on the head entity data and the angle data, the predicted angle data from the head entity to the tail entity is determined.
2. The method according to claim 1, wherein, Based on the tail entity data and the predicted tail entity data, the representation data of the tail entity is determined to include: Based on the predicted modulus length data and the tail entity data, determine the modulus length difference data; Based on the predicted angle data and the tail entity data, determine the angle difference data; and Based on the modulus difference data and the angle difference data, the representation data of the tail entity is determined.
3. The method according to claim 1, further comprising: The head entity data and the tail entity data are represented by multiple sub-entity data.
4. The method according to claim 3, further comprising: The head entity data, the module length data, and the angle data are input into the prediction module of the knowledge representation model that captures the hierarchical structure of the knowledge graph, and the predicted tail entity data is output.
5. The method according to claim 4, wherein, During the training of the knowledge representation model that captures the hierarchical structure of the knowledge graph, the multiple sub-entity data share the same relational parameters.
6. A knowledge representation device for capturing the hierarchical structure of a knowledge graph, comprising: The acquisition module is used to acquire the initial data of knowledge graph triples, wherein the knowledge graph triples include a head entity, a tail entity, and the association relationship between the head entity and the tail entity; The first determining module is used to determine the complex vector data of the knowledge graph triple based on the initial data of the knowledge graph triple. The complex vector data includes head entity data, tail entity data, modulus data and angle data of the association relationship between the head entity and the tail entity. The second determining module is used to determine the predicted tail entity data based on the head entity data, the module length data, and the angle data. as well as The knowledge representation module is used to determine the representation data of the tail entity based on the tail entity data and the predicted tail entity data, wherein the representation data is used to represent the hierarchical structure of the knowledge graph. The predicted tail entity data includes predicted modulus data and predicted angle data; wherein, the second determining module is further configured to: Based on the head entity data and the module length data, determine the predicted module length data from the head entity to the tail entity; and Based on the head entity data and the angle data, the predicted angle data from the head entity to the tail entity is determined.
7. An electronic device, comprising: One or more processors; Memory, used to store one or more instructions. When the one or more instructions are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method of any one of claims 1 to 5.
8. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the method of any one of claims 1 to 5.
9. A computer program product comprising computer-executable instructions, which, when executed, are used to implement the method of any one of claims 1 to 5.
Citation Information
Patent Citations
Knowledge graph representation learning method based on ternary interaction
CN111914094A
Embedded representation model training method, and knowledge graph-based question and answer method and device
CN113553386A