Multivariate fact hypergraph representation method, device, equipment, medium and program product
By representing entity relationships of multivariate facts in hyperbolic space and adjusting them using hyperbolic polygons or hyperbola segments, the problems of structural and semantic integrity destruction and insufficient capture of hierarchical relationships in existing methods are solved, thus achieving efficient representation of multivariate knowledge hypergraphs.
Patent Information
- Application Number
- CN202210665193.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-13
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2042-06-13
AI Technical Summary
While existing multivariate knowledge hypergraph representation learning methods have made progress in metrics such as hit rate and reciprocal ranking, they suffer from problems such as disrupting the multivariate fact structure and semantic integrity, failing to capture hierarchical relationships, requiring a large number of parameters for training, and incurring high time and space complexity.
The system maps entities of multiple facts to hyperbolic space, uses hyperbolic polygons or hyperbolic segments to represent entity relationships, trains negative samples through Riemann gradient descent and cross-entropy loss, and adjusts hyperbolic polygons or hyperbolic segments to capture hierarchical structure and reduce parameters.
Maintain the semantic and structural integrity of diverse facts, capture hierarchical relationships, reduce the number of parameters, improve training efficiency, and avoid overfitting.
Smart Images

Figure CN117272039B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the field of machine learning and data mining, and in particular, to a multi-fact hypergraph representation method, device, equipment, medium and program product. BACKGROUND
[0002] In recent years, the research on knowledge graph has been highly valued by the academic and industrial circles. Among them, the representation learning of embedding entities and relationships into low-dimensional vectors is an important research direction in the field of knowledge graph, which plays a huge role in the storage of knowledge graph, the reasoning of missing relationships, the recommendation of knowledge, etc. The representation learning of binary knowledge graph involving two entities has been widely studied, while the research on multi-fact hypergraph involving two or more entities is relatively less.
[0003] The existing binary knowledge representation learning methods include distance-based translation models, deep learning-based models and semantic-based matching models. The existing multi-fact hypergraph representation learning methods can also be roughly divided into the above three categories. Although the existing methods have made great progress in hit rate, reciprocal rank and other indicators, they still have some shortcomings:
[0004] (1) The multi-fact is decomposed into sub-tuples, and only the matching degree of entities and main triples is calculated, which destroys the structural and semantic integrity of multi-fact.
[0005] (2) Usually, entities and relationships are represented as vectors in Euclidean space, while there are rich hierarchical relationships in multi-fact, which may not be well captured in Euclidean space.
[0006] (3) It cannot be self-adaptive to any fact, and a large number of parameters are designed for training, which has relatively high time complexity and space complexity, and is prone to overfitting. SUMMARY
[0007] In view of the above problems, the present disclosure provides a multi-fact hypergraph representation method, device, equipment, medium and program product.
[0008] According to a first aspect of the present disclosure, a multi-fact hypergraph representation method is provided, comprising:
[0009] Mapping all entities participating in the multi-fact in hyperbolic space to represent as initial points in the hyperbolic space;
[0010] Obtaining the relationship between the entities;
[0011] Moving all initial points according to the relationship to generate hyperbolic polygons or hyperbolic line segments in the hyperbolic space.
[0012] According to an embodiment of the present disclosure, the representation method further comprises:
[0013] calculating the distance from the initial point to the centroid of the hyperbolic polygon or the midpoint of the hyperbolic segment;
[0014] calculating the matching degree of the entity corresponding to the initial point and the multi-fact according to the numerical value of the distance;
[0015] adjusting the hyperbolic polygon or the hyperbolic segment according to the matching degree.
[0016] According to an embodiment of the present disclosure, adjusting the hyperbolic polygon or the hyperbolic segment according to the matching degree comprises:
[0017] collecting n negative samples of each entity;
[0018] training and gradient updating the negative samples according to the matching degree to obtain the position of the point of the entity;
[0019] moving the initial point of the entity to the position to adjust the hyperbolic polygon or the hyperbolic segment.
[0020] According to an embodiment of the present disclosure, training and gradient updating the negative samples comprise:
[0021] training and learning the negative samples by using the cross-entropy loss method;
[0022] gradient updating the negative samples by using the Riemann gradient descent method.
[0023] According to an embodiment of the present disclosure, the moving comprises rotation or translation.
[0024] According to an embodiment of the present disclosure, the matching degree and the distance are in a negative correlation.
[0025] A second aspect of the present disclosure provides a multi-fact hypergraph representation device, comprising:
[0026] a mapping module configured to map all entities participating in the multi-fact in a hyperbolic space to represent as initial points in the hyperbolic space;
[0027] an obtaining module configured to obtain the relationship between the entities; and
[0028] a generating module configured to move all the initial points according to the relationship to generate a hyperbolic polygon or a hyperbolic segment in the hyperbolic space.
[0029] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; a memory configured to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors perform the multi-fact hypergraph representation method described above.
[0030] The fourth aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the multi-fact supergraph representation method.
[0031] The fifth aspect of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the multi-fact supergraph representation method. BRIEF DESCRIPTION OF DRAWINGS
[0032] 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:
[0033] Figure 1 An application scenario diagram of the multi-fact supergraph representation method, apparatus, device, medium and program product according to embodiments of the present disclosure is schematically shown;
[0034] Figure 2 A structural diagram of a hyperbolic polygon according to embodiments of the present disclosure is schematically shown;
[0035] Figure 3 A structural diagram of entity and relationship representation according to embodiments of the present disclosure is schematically shown;
[0036] Figure 4 A demonstration diagram of vertex movement according to embodiments of the present disclosure is schematically shown;
[0037] Figure 5 A structural block diagram of the multi-fact supergraph representation apparatus according to embodiments of the present disclosure is schematically shown; and
[0038] Figure 6 A block diagram of an electronic device suitable for implementing the multi-fact supergraph representation method according to embodiments of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0039] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood, however, that the description which follows is merely exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description of 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 one or more embodiments of the present disclosure can be practiced without these specific details. In other instances, well-known structures and functions have not been described in detail in order to avoid obscuring the concepts of the present disclosure.
[0040] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used herein, the terms "comprises", "comprising", "includes", "including" and the like are specifically intended to be open-ended and to mean that other features, steps, operations, and / or components can be added.
[0041] 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 are defined as having meanings that are consistent with the context of the specification in which they are used, and should not be interpreted in an overly idealized or overly formal way.
[0042] In situations where similar terminology is used for similar items, it is to be understood that there is no intention to limit such terms to the specific examples described unless otherwise explicitly stated. For example, "a" and "an" are often used herein to refer to one or to more than one (i.e., to "one or more") of the referenced items.
[0043] Knowledge graph is an important research direction in the field of natural language processing and data mining. The representation learning of knowledge graph, as an underlying task, has great application potential similar to word embedding. The representation of multi-element knowledge hypergraph in the knowledge graph mainly includes translation model, semantic matching model and deep learning model. These representation models of multi-element knowledge hypergraph have some problems. They usually decompose multi-element facts into smaller sub-tuples, which destroys the semantic and structural integrity of multi-element facts. In addition, in the multi-element knowledge hypergraph, more entities are involved in a single multi-element fact, which leads to a more complex hierarchical structure of the multi-element knowledge hypergraph. The existing methods usually ignore these hierarchical structures. Moreover, the existing deep models usually involve a large number of parameters, which are not suitable for large-scale use.
[0044] Therefore, embodiments of the present disclosure provide a multi-element fact hypergraph representation method. All entities involved in the multi-element fact are mapped in hyperbolic space to represent as initial points in the hyperbolic space. Then the relationship between the entities is obtained. Finally, all initial points are moved according to the relationship to generate hyperbolic polygons or hyperbolic line segments in the hyperbolic space. The present disclosure also provides a multi-element fact hypergraph representation device, equipment, medium and program product.
[0045] Figure 1 An application scenario diagram of the multi-element fact hypergraph representation according to an embodiment of the present disclosure is schematically shown.
[0046] As Figure 1As shown, the application scenario 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, and the like.
[0047] 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, and the like. Various communication client applications can be installed on the terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, and the like (only as examples).
[0048] 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, and the like.
[0049] 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 a terminal device 101, 102, 103 (only as an example). The background management server can analyze and process received user requests and the like, and feed back the processing results (such as a webpage, information, or data, or the like, obtained or generated according to a user request) to a terminal device.
[0050] It should be noted that the multi-fact hypergraph representation method provided by the embodiments of the present disclosure can generally be executed by the server 105. Accordingly, the multi-fact hypergraph representation apparatus provided by the embodiments of the present disclosure can generally be arranged in the server 105. The multi-fact hypergraph representation method 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. Accordingly, the multi-fact hypergraph representation apparatus 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.
[0051] It should be understood that Figure 1 The number of terminal devices, networks, and servers in the above-mentioned application scenario is only illustrative. According to the needs of implementation, there can be any number of terminal devices, networks, and servers.
[0052] The multi-fact hypergraph representation method provided by the embodiments of the present disclosure will be described in detail below based on the scenario described above. Figure 1 Figures 2-4 The multi-fact hypergraph representation method provided by the embodiments of the present disclosure will be described in detail below based on the scenario described above.
[0053] Figure 2 A flowchart illustrating a multivariate fact hypergraph representation method according to an embodiment of the present disclosure is shown schematically. Figure 3 The diagram illustrates a structural schematic of entity and relation representations according to embodiments of the present disclosure. Figure 4 A schematic diagram illustrating vertex movement according to an embodiment of the present disclosure is shown.
[0054] like Figure 2 As shown, the multi-fact hypergraph representation method of this embodiment includes operations S210 to S230.
[0055] In operation S210, all entities involved in the multivariate facts are mapped onto hyperbolic space to be represented as initial points in hyperbolic space;
[0056] In this operation, vertices can also be vectors. Figure 2 In this example, for ease of illustration, points are depicted in two-dimensional space, and their coordinates can be considered as vectors. In higher-dimensional space, a point also has coordinates, which can be viewed as a higher-dimensional vector pointing from the origin to its location. Initially, the embeddings of all entities and relationships are unknown, and these embeddings are typically randomly initialized; therefore, the coordinates of each initial point are also randomly initialized. The n (n≥2) entities involved in the fact are denoted as e1~e1. n When n entities are connected sequentially, they form an initial hyperbolic polygon. When n=2, e1 and e2 are connected to form an initial hyperbola segment. The initial point is the vertex of the initial hyperbolic polygon or the initial hyperbola segment. Figure 3 As shown, Figure 3 The diagram below shows a structure with four entities as an example.
[0057] In operation S220, the relationships between entities are obtained;
[0058] In operation S230, all initial points are moved according to the relationship to generate hyperbolic polygons or hyperbola segments in hyperbolic space.
[0059] In this operation, the relation in a multivariate fact is denoted as r. Since the multivariate knowledge hypergraph contains both multivariate and binary knowledge, this invention uses hyperbolic polygons to model multivariate facts with more than two grammatical elements, and hyperbolic segments to model binary facts. The polygonal structure maintains the semantic and structural integrity of the multivariate facts, while the hyperbolic space captures the hierarchical structure and reduces the number of parameters. The relations involving the facts are denoted as r1 to r2. nThe initial hyperbolic polygon or the initial hyperbolic segment is moved according to the corresponding relationship, and the matched entities are close to each other, and the initial hyperbolic segment is shortened to generate a hyperbolic segment in the hyperbolic space, and the initial hyperbolic polygon is reduced to generate a hyperbolic polygon, as shown in Figure 4 , Figure 4 There are five entities, and one entity corresponding to e1 is moved to a position close to the centroid O. The moving mode includes rotation or translation. It should be noted that the hyperbolic space has a Poincare disk, a hemisphere and an Einstein space, and the structure used in the application is a Poincare disk, which is an open ball, Figure 3 and Figure 4 The circle in the formula represents the Poincare disk.
[0060] The multi-fact hypergraph representation method disclosed in the embodiment represents the multi-fact as a polygon structure, can maintain the integrity of the semantics and structure of the multi-fact, and meanwhile, considering the rich hierarchical structure contained in the multi-knowledge hypergraph, a hyperbolic polygon structure is used to model the multi-knowledge, so as to better capture the hierarchical information, and in the hyperbolic space, a lower dimension can represent complex information, thereby avoiding overfitting.
[0061] As an optional embodiment, the multi-fact hypergraph representation method further includes: calculating the distance from the initial point to the centroid of the hyperbolic polygon or the midpoint of the hyperbolic segment; calculating the matching degree of the entity corresponding to the initial point and the multi-fact according to the numerical value of the distance; and adjusting the hyperbolic polygon or the hyperbolic segment according to the matching degree, and the matching degree and the distance are negatively related.
[0062] In the embodiment, for the hyperbolic polygon with e1-e n as the vertex, the calculation method of the centroid is as follows:
[0063]
[0064] The distance from the vertex to the centroid of the hyperbolic polygon is used to measure the matching degree of the single entity and the whole fact, and the calculation method of the distance from the vertex e to the centroid is as follows:
[0065]
[0066] Wherein is the gamma factor in the theory of relativity. The formula is obtained by substituting x = e i The calculated centroid is a multi-dimensional vector, and each dimension represents a feature in the dimension. C is the curvature of the hyperbolic space, and generally takes a value of 1. tanh -1 is a function, that is, the artanh function.
[0067] The greater the vertex-to-centroid distance, the lower the score, and the closer the vertex-to-centroid distance, the higher the score. After multiple rounds of training, the model can learn the vector representation of entities and relationships in the hyperbolic space in the multi-knowledge hypergraph, which can be used for downstream tasks. The adjustment of the hyperbolic polygon or hyperbolic line segment according to the matching degree comprises: collecting n negative samples of each entity; training and gradient updating the negative samples according to the matching degree, and the correct samples will be closer and closer to the hyperbolic centroid or hyperbolic midpoint, while the negative samples will be farther and farther away from the hyperbolic centroid or hyperbolic midpoint. The position of the point of the entity is obtained; the initial point of the entity moves to the position to adjust the hyperbolic polygon or hyperbolic line segment.
[0068] As an optional embodiment, the training and gradient updating of the negative samples comprise: training and learning the negative samples by using the cross-entropy loss method; and updating the gradient of the negative samples by using the Riemann gradient descent method.
[0069] The multi-knowledge hypergraph representation method disclosed in the embodiment can measure the matching degree of an entity and the entire multi-knowledge fact by using the distance from the vertex to the centroid of the hyperbolic polygon, and can directly calculate the matching degree of a single entity and the entire fact without splitting the fact.
[0070] Based on the above multi-knowledge hypergraph representation method, the disclosure further provides a multi-knowledge hypergraph representation device. The following will be described in detail in combination with Figure 4 the device.
[0071] Figure 5 The structure block diagram of the multi-knowledge hypergraph representation device according to the embodiment of the disclosure is schematically shown.
[0072] As Figure 5 shown, the multi-knowledge hypergraph representation device 400 of the embodiment comprises a mapping module 410, an acquisition module 420 and a generation module 430.
[0073] The mapping module 410 is configured to map all entities participating in the multi-knowledge fact in the hyperbolic space to be represented as initial points in the hyperbolic space. In an embodiment, the mapping module 410 can be configured to perform the operation S210 described above, which will not be described here again.
[0074] The acquisition module 420 is configured to acquire the relationship between the entities. In an embodiment, the acquisition module 420 can be configured to perform the operation S220 described above, which will not be described here again.
[0075] The generation module 430 is configured to move all initial points according to the relationship to generate a hyperbolic polygon or a hyperbolic line segment in the hyperbolic space. In an embodiment, the generation module 430 can be configured to perform the operation S230 described above, which will not be described here again.
[0076] According to an embodiment of the present disclosure, any of the mapping module 410, the obtaining module 420 and the generating module 430 can be combined in one module, or any of them can be split into multiple modules. Alternatively, at least part of the function of one or more of these modules can be combined with at least part of the function of the other modules, and implemented in one module. According to an embodiment of the present disclosure, at least one of the mapping module 410, the obtaining module 420 and the generating module 430 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on board, a system on package, an application specific integrated circuit (ASIC), or any other reasonable way of hardware or firmware that can be integrated or packaged with a circuit, or implemented in any one of software, hardware and firmware or in a proper combination of any of them. Alternatively, at least one of the mapping module 410, the obtaining module 420 and the generating module 430 can be at least partially implemented as a computer program module that can perform the corresponding function when it is run.
[0077] Figure 6 A block diagram of an electronic device suitable for implementing the multi-factored hypergraph representation method according to an embodiment of the present disclosure is schematically shown.
[0078] As shown in Figure 6 The electronic device 900 according to an embodiment of the present disclosure includes a processor 901 that can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 902 or loaded from a storage portion 908 into a random access memory (RAM) 903. The processor 901 can include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor, and / or a related chipset, and / or a special-purpose microprocessor (e.g., an application specific integrated circuit (ASIC)), and the like. The processor 901 can also include an on-board memory for cache use. The processor 901 can include a single processing unit or multiple processing units for performing different actions of the method processes according to embodiments of the present disclosure.
[0079] In the RAM 903, various programs and data required for the operation of the electronic device 900 are stored. The processor 901, the ROM 902 and the RAM 903 are connected to each other through a bus 904. The processor 901 performs various operations of the method processes according to embodiments of the present disclosure by executing programs in the ROM 902 and / or the RAM 903. It should be noted that the programs can also be stored in one or more memories other than the ROM 902 and the RAM 903. The processor 901 can also perform various operations of the method processes according to embodiments of the present disclosure by executing programs stored in the one or more memories.
[0080] According to embodiments of this disclosure, the electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to a bus 904. The electronic device 900 may also include one or more of the following components connected to the I / O interface 905: an input section 906 including a keyboard, mouse, etc.; an output section 907 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 910 as needed so that computer programs read from it can be installed into the storage section 908 as needed.
[0081] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0082] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 902 and / or RAM 903 and / or one or more memories other than ROM 902 and RAM 903 described above.
[0083] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the item recommendation method provided in the embodiments of this disclosure.
[0084] When the computer program is executed by the processor 901, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0085] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 909, and / or installed from a removable medium 911. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0086] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 909, and / or installed from the removable medium 911. When the computer program is executed by the processor 901, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0087] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on a user's computing device, partially on a user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0088] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0089] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0090] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.
Claims
1. A method for representing multivariate fact hypergraphs, characterized in that, include: All entities participating in the multivariate facts are mapped onto a hyperbolic space, denoted as initial points in the hyperbolic space. Initially, the embeddings of all entities and relations are unknown; these embeddings are randomly initialized. Therefore, the coordinates of each initial point are also randomly initialized. The n entities participating in the facts are denoted as e1 to e2. n Where n≥2, n entities are connected in sequence to form an initial hyperbolic polygon. When n=2, e1 and e2 are connected to form an initial hyperbola segment. The initial point is the vertex of the initial hyperbolic polygon or the initial hyperbola segment. Obtain the relationships between the entities; All the initial points are moved according to the aforementioned relationship to generate hyperbolic polygons or hyperbola segments in the hyperbolic space; wherein the relationships involving the facts are denoted as r1 to r2. n Each vertex of the initial hyperbolic polygon or initial hyperbola segment moves according to the correspondence, and the matching entities move closer to each other. In hyperbolic space, this is represented by the initial hyperbola segment shortening to generate a hyperbola segment, and the initial hyperbolic polygon shrinking to generate a hyperbolic polygon. The movement can be either rotation or translation.
2. The representation method according to claim 1, characterized in that, The representation method further includes: Calculate the distance from the initial point to the centroid of the hyperbolic polygon or the midpoint of the hyperbola segment; The matching degree between the entity corresponding to the initial point and the multivariate facts is calculated based on the distance value; Adjust the hyperbolic polygon or the hyperbola segment according to the matching degree.
3. The representation method according to claim 2, characterized in that, The step of adjusting the hyperbolic polygon or the hyperbola segment according to the matching degree includes: Collect n negative samples for each of the entities; The negative samples are trained and gradients are updated based on the matching degree to obtain the position of the entity's points; The initial point of the entity is moved to the position to adjust the hyperbolic polygon or the hyperbola segment.
4. The representation method according to claim 3, characterized in that, The step of training and gradient updating the negative samples includes: The negative samples are trained using the cross-entropy loss method. The negative samples are updated using the Riemann gradient descent method.
5. The representation method according to claim 2, characterized in that, The matching degree is negatively correlated with the distance.
6. A multi-fact hypergraph representation device, comprising: The mapping module is used to map all entities participating in the multivariate facts onto a hyperbolic space, represented as initial points in the hyperbolic space. Initially, the embeddings of all entities and relations are unknown; these embeddings are randomly initialized. Therefore, the coordinates of each initial point are also randomly initialized. The n entities participating in the facts are denoted as e1 to e2. n Where n≥2, n entities connected in sequence form an initial hyperbolic polygon. When n=2, e1 and e2 are connected to form an initial hyperbola segment. The initial point is the vertex of the initial hyperbolic polygon or the initial hyperbola segment. The acquisition module is used to acquire the relationships between the entities; and The generation module is used to move all the initial points according to the relationship to generate hyperbolic polygons or hyperbola segments in the hyperbolic space; wherein the relationship of the participating facts is denoted as r1~r n Each vertex of the initial hyperbolic polygon or initial hyperbola segment moves according to the correspondence, and the matching entities move closer to each other. In hyperbolic space, this is represented by the initial hyperbola segment shortening to generate a hyperbola segment, and the initial hyperbolic polygon shrinking to generate a hyperbolic polygon. The movement can be either rotation or translation.
7. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the method according to 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 according to any one of claims 1 to 5.
9. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Knowledge graph representation learning method for distinguishing data types in hyperbolic space
CN113673703A
Question and answering method for embedding multiple knowledge maps in combination with hyperbolic segmented knowledge of text
CN113779219A