Learning embedding method and device for double-view knowledge graph, electronic equipment and medium
Through the learning embedding method of dual-perspective knowledge graphs, using Riemann manifold space and attention fusion model of multiple curvature types, the problem of limitations of knowledge graph feature representation in the existing technology is solved, and more accurate urban road flow data representation is achieved .
Patent Information
- Application Number
- CN202411352474.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-09-26
AI Technical Summary
The existing knowledge graph learning embedding method has limitations in character representation when processing complex urban road traffic data, and it is impossible to fully capture global and local structures.
A learning embedding method of two-perspective knowledge graph is proposed, and the embedding of entities is modeled through global and local perspectives, and the Riemann manifold space (hyperbolic space, hyperbolic space and Euclidean space) of various curvature types is used for Feature transformation and fuse multiple local features through attention fusion model to obtain entity fusion features.
Through the dual-perspective analysis method, more accurate knowledge graph representation can be learned, which can better capture the global and local structural information in urban road traffic data and improve the accuracy and reliability of the scoring results.
Smart Images

Figure CN119398156A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of knowledge graph learning, and in particular to a learning embedding method, device, electronic device and medium for a dual-view knowledge graph. Background Art
[0002] In the fields of intelligent transportation systems, urban planning and management, knowledge graphs are widely used as a powerful semantic representation tool to integrate and express complex data relationships. Especially in urban road flow assessment, knowledge graphs can effectively organize multi-source heterogeneous data such as road networks, traffic flows, and traffic events, providing a basis for accurate prediction and decision support. However, existing knowledge graph learning embedding methods only learn from a single perspective when processing such complex data, resulting in certain limitations in the learned feature representation. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to propose a dual-perspective knowledge graph learning embedding method, device, electronic device and medium, aiming to model the embedding of entities from two perspectives, global and local, so as to learn a more accurate knowledge graph representation.
[0004] To achieve the above objectives, a first aspect of an embodiment of the present application proposes a learning embedding method for a dual-view knowledge graph, the method comprising:
[0005] Acquire urban road data and road flow speed data, and construct an initial knowledge graph based on the urban road data and the road flow speed data;
[0006] Determine a triple to be evaluated according to entities corresponding to each urban road in the initial knowledge graph and the relationship between the entities;
[0007] Performing global mapping conversion processing on the entity embedding features of the triples to obtain entity global features;
[0008] Performing local mapping conversion processing on the entity global features to obtain entity hyperspherical features, entity hyperbolic features and entity Euclidean features respectively;
[0009] Inputting the entity global feature, the entity hyperspherical feature, the entity hyperbolic feature and the entity Euclidean feature into an attention fusion model to obtain an entity fusion feature;
[0010] Obtaining a score value for the triple according to the entity global feature and the entity fusion feature;
[0011] The relationships between entities in the initial knowledge graph are updated according to the scoring values to obtain a target knowledge graph.
[0012] In some embodiments, performing global mapping conversion processing on the entity embedding features of the triples to obtain entity global features includes:
[0013] Inputting the entity embedding features of the triple into a first mapping model of a preset Euclidean space to a hyperbolic space to obtain entity global features; wherein the entity embedding features include a head entity embedding feature and a tail entity embedding feature, and the entity global features include a head entity global feature and a tail entity global feature;
[0014] Wherein, the first mapping model is:
[0015]
[0016] Among them, e H is the entity global feature, is the first mapping model, c represents the space curvature, v represents the entity embedding feature, is the Möbius addition, ‖·‖2 represents the second mode of the vector, x is the mapping horizontal coordinate, and x=0.
[0017] In some embodiments, the local mapping conversion processing is performed on the entity global feature to obtain the entity hyperspherical feature, entity hyperbolic feature and entity Euclidean feature respectively, including:
[0018] Inputting the entity global feature into a preset second mapping model from Euclidean space to hypersphere space to obtain entity hypersphere feature; wherein the entity hypersphere feature includes a head entity hypersphere feature and a tail entity hypersphere feature;
[0019] Wherein, the second mapping model is:
[0020]
[0021] in, is the solid hypersphere feature, is the second mapping model, x=0;
[0022] Inputting the entity global feature into a third mapping model that maps a preset Euclidean space to a hyperbolic space to obtain an entity hyperbolic feature; wherein the entity hyperbolic feature includes a head entity hyperbolic feature and a tail entity hyperbolic feature;
[0023] Wherein, the third mapping model is:
[0024]
[0025] in, is the hyperbolic feature of the entity, is the third mapping model, x=0;
[0026] The entity global feature is used as an entity Euclidean feature; wherein the entity Euclidean feature includes a head entity Euclidean feature and a tail entity Euclidean feature.
[0027] In some embodiments, inputting the entity global feature, the entity hyperspherical feature, the entity hyperbolic feature, and the entity Euclidean feature into an attention fusion model to obtain the entity fusion feature includes:
[0028] Get the preset rotation transformation matrix and translation transformation parameters;
[0029] According to the rotation transformation matrix and the translation transformation parameter, the entity hypersphere feature, the entity hyperbolic feature and the entity Euclidean feature are subjected to rotation and translation processing to obtain a first hypersphere feature, a first hyperbolic feature and a first Euclidean feature respectively;
[0030] The entity global feature, the first hypersphere feature, the first hyperbolic feature and the first Euclidean feature are input into an attention fusion model to obtain an entity fusion feature; wherein the entity fusion feature includes a head entity fusion feature and a tail entity fusion feature.
[0031] In some embodiments, inputting the entity global feature, the first hyperspherical feature, the first hyperbolic feature, and the first Euclidean feature into an attention fusion model to obtain the entity fusion feature includes:
[0032] Get the preset attention vector;
[0033] According to the entity global feature, the first hypersphere feature, the first hyperbolic feature, the first Euclidean feature and the attention vector, a first attention score about the first hypersphere feature, a second attention score about the first hyperbolic feature and a third attention score about the first Euclidean feature are calculated;
[0034] An entity fusion feature is obtained according to the product of the first attention score and the first hypersphere feature, the product of the second attention score and the first hyperbolic feature, and the product of the third attention score and the first Euclidean feature.
[0035] In some embodiments, the entity global feature includes a head entity global feature and a tail entity global feature, and the entity fusion feature includes a head entity fusion feature and a tail entity fusion feature;
[0036] The step of obtaining a score value for the triplet according to the entity global feature and the entity fusion feature includes:
[0037] Obtaining a first predicted distance value according to the head entity global feature and the tail entity fusion feature;
[0038] Obtaining a second predicted distance value according to the tail entity global feature and the head entity fusion feature;
[0039] A score value for the triple is obtained according to the first predicted distance value and the second predicted distance value.
[0040] In some embodiments, obtaining a first predicted distance value according to the head entity global feature and the tail entity fusion feature includes:
[0041] According to the global features of the head entity and the fusion features of the tail entity, a first predicted distance value is calculated by a preset distance prediction formula;
[0042] Wherein, the distance prediction formula is:
[0043]
[0044] in, represents the first predicted distance value, is the tail entity fusion feature, h H is the global feature of the head entity, c represents the spatial curvature, is the Möbius addition, ‖·‖2 represents the second modulus of the vector;
[0045] The step of obtaining a score value for the triplet according to the first predicted distance value and the second predicted distance value includes:
[0046] According to the first predicted distance value and the second predicted distance value, a score value for the triplet is calculated by a preset evaluation model;
[0047] Wherein, the evaluation model is:
[0048]
[0049] Among them, Φ(h,r,t) represents the score value of the triple, represents the second predicted distance value, and b is the score compensation value.
[0050] In some embodiments, after the step of updating the initial knowledge graph according to the scoring value to obtain the relationship between entities in the target knowledge graph, the method further includes:
[0051] Obtaining training triples from the target knowledge graph;
[0052] According to the training triplet, a training score value for the training triplet is obtained.
[0053] Inputting the training triplet into a preset urban road traffic flow assessment model to obtain training output features;
[0054] Calculating a loss value according to the training triplet, the training output feature and the training score value;
[0055] The parameters of the urban road flow evaluation model are optimized according to the loss value until the loss value meets the preset conditions.
[0056] To achieve the above purpose, the second aspect of the embodiment of the present application proposes a learning embedding device for a dual-view knowledge graph, the device comprising:
[0057] An acquisition module, used to acquire urban road data and road flow speed data, and construct an initial knowledge graph based on the urban road data and the road flow speed data;
[0058] A determination module, used to determine the triples to be evaluated according to the entities corresponding to the urban roads in the initial knowledge graph and the relationships between the entities;
[0059] A global mapping module, used for performing global mapping conversion processing on the entity embedding features of the triplet to obtain entity global features;
[0060] A local mapping module is used to perform local mapping conversion processing on the entity global feature to obtain entity hyperspherical feature, entity hyperbolic feature and entity Euclidean feature respectively;
[0061] A fusion module, used for inputting the entity hyperspherical feature, the entity hyperbolic feature and the entity Euclidean feature into an attention fusion model to obtain an entity fusion feature;
[0062] A scoring module, used for obtaining a scoring value for the triplet according to the entity global feature and the entity fusion feature;
[0063] An updating module is used to update the initial knowledge graph according to the scoring value to obtain a target knowledge graph.
[0064] To achieve the above objectives, a third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.
[0065] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0066] The learning embedding method and device, electronic device and storage medium of the dual-view knowledge graph proposed in the present application obtain urban road data and road flow speed data, and form an initial knowledge graph. According to the entities corresponding to the pre-evaluated urban roads in the initial knowledge graph, a series of triples to be evaluated are selected or generated from the initial knowledge graph. These triples represent key information points or potential relationships in the knowledge graph. Subsequently, the entity embedding features of the triples are processed by a dual-view analysis method, specifically, the entity embedding features are globally mapped and transformed to obtain entity global features. The global features are further converted into a variety of local features (hypersphere features, hyperbolic features, Euclidean features) to capture local information from different perspectives, and the attention fusion model is used to fuse a variety of local features to obtain entity fusion features. Then, the score value of the triple is calculated using the entity global features and entity fusion features obtained above, which reflects the rationality and importance of the triple in the knowledge graph. The score value not only considers the global position and relationship of the entity, but also incorporates rich local detail information, making the scoring result more accurate and reliable. According to the score value, the relationship between entities in the initial knowledge graph triples is screened, adjusted or added to optimize the structure and content of the knowledge graph to obtain a more complete and accurate target knowledge graph. The present invention uses Riemann manifold spaces of various curvature types (hyperbolic space, hyperspherical space and Euclidean space) to model the embedding of entities from both global and local perspectives, thereby learning a more accurate knowledge graph representation. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 It is a flowchart of the learning embedding method of the dual-view knowledge graph provided in the embodiment of the present application;
[0068] Figure 2 yes Figure 1 Flowchart of step S130 and step S140 in FIG. 1 ;
[0069] Figure 3 yes Figure 1 Flow chart of step S150 in FIG.
[0070] Figure 4 yes Figure 3 Flow chart of step S430 in FIG.
[0071] Figure 5 yes Figure 1 Flow chart of step S160 in FIG.
[0072] Figure 6 yes Figure 1 The flowchart after step S170 in FIG.
[0073] Figure 7It is a structural diagram of a learning embedding device for a dual-view knowledge graph provided in an embodiment of the present application;
[0074] Figure 8 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0075] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0076] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0077] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0078] First, some nouns involved in this application are analyzed:
[0079] Knowledge Graph: It is called knowledge domain visualization or knowledge domain mapping map in the library and information industry. It is a series of various graphs that show the development process and structural relationship of knowledge. It uses visualization technology to describe knowledge resources and their carriers, and to mine, analyze, construct, draw and display knowledge and their interrelationships.
[0080] Triples: usually composed of three elements: head entity, relationship, and tail entity. The relationship between them can be expressed as: head entity-relationship-tail entity. Triples in the knowledge graph are the basis for building the entire knowledge graph. Through a large amount of triple data, a large and complex knowledge network can be constructed, thereby achieving a comprehensive description and understanding of various entities and relationships in the real world.
[0081] Euclidean Space: Also known as Euclidean space, it is one of the most basic spaces in mathematics. It has the characteristics of linearity, measurable distance and definable angle. In Euclidean space, vectors can be added, subtracted, multiplied and divided, and satisfy basic properties such as the commutative law and associative law of vector addition. The distance in Euclidean space can be calculated by the inner product of vectors, which satisfies properties such as non-negativity, symmetry and triangle inequality.
[0082] Hyperbolic Space: A homogeneous space with constant negative curvature, in contrast to the zero curvature of Euclidean space. Hyperbolic geometry provides efficient methods for learning low-dimensional embeddings of hierarchical data. In particular, tree-like data can be embedded with arbitrarily low distortion using only two-dimensional hyperbolic space. Hyperbolic space is more efficient than Euclidean space in representing data with rich hierarchical structures.
[0083] Hyperspheric Space: refers to a spherical region in high-dimensional space, which can be regarded as the generalization of the sphere in Euclidean space in high-dimensional space. In hyperspheric space, all points are located on a sphere with a fixed radius, which gives hyperspheric space some unique properties, such as nonlinearity of distance measurement and weakening of dimensionality effect.
[0084] Attention fusion model: is a method in the field of deep learning, especially when dealing with complex data and tasks, to improve model performance and effect by fusing different attention mechanisms or features. The core idea of this model is to use the attention mechanism to guide the model to pay more attention to the key information in the input data, and then enhance the model's representation and generalization capabilities by fusing attention weights or features from different sources or types.
[0085] In the fields of intelligent transportation systems, urban planning and management, knowledge graphs are widely used as a powerful semantic representation tool to integrate and express complex data relationships. Especially in urban road flow assessment, knowledge graphs can effectively organize multi-source heterogeneous data such as road networks, traffic flows, and traffic events, providing a basis for accurate prediction and decision support. However, existing knowledge graph learning embedding methods often face a key technical challenge when processing such complex data: the limitations of feature representation.
[0086] Traditional knowledge graph embedding methods mostly focus on extracting single features from a global or local perspective. Global perspective methods, such as TransE, TransH, TransR, and TransD, capture global structural information in knowledge graphs by defining translation or rotation rules for entities and relationships in vector space. Although such methods can better maintain the overall consistency of the graph, they are unable to cope with local details and specific contextual information, and are prone to losing some crucial local features.
[0087] Specifically, from a global perspective, knowledge graph embedding methods generally embed nodes and relationships by defining a unified paradigm (such as embedding space, operators, etc.), thereby ignoring the spatial characteristics of the inherent local structure of the knowledge graph. TransE is the first method to embed knowledge graphs in a geometric way. It mainly embeds entities and relationships as points and translation transformations in an n-dimensional vector space, such as h+r≈t, where h and t are vector embeddings of entities and t are transformation modeling forms of relationships, thereby modeling some simple spatial structures. TransH attempts to model hierarchical relationships (or many-to-many problems) in knowledge graphs by performing linear transformations on each node according to the relationship type. Then, in order to further improve the representation ability of Euclidean space, TransR embeds relationships and entities into different spaces, while TransD does not reduce the number of parameters while not reducing the representation performance of the model.
[0088] However, translation transformations cannot always satisfy more complex relationship types (for example, symmetry / antisymmetry, reversible relationships, etc.). RotatE first extended the relationship embedding to the complex plane, thereby promoting the model to learn more accurate embeddings. Subsequently, many methods based on rotation were proposed. QuatE first expanded the space to a four-dimensional hypercomplex space and used quaternions to model entities and relationships; BiQUE expanded it to dual quaternions; Rotate3D used 3D rotation for modeling; and OTE generalized the rotation transformation. Other methods that use semantic matching to capture global structural features based on complex space include Comp l Ex, Hol E, and Hol l Ex.
[0089] ManifoldE is the first embedding method to introduce the concept of manifold into the field of knowledge graph embedding, which is used to locate the global structural position relationship of entities in the manifold space. Due to the metric characteristics of manifold space, some work has proved that facade geometry has a strong expressiveness for embedding non-Euclidean structured data. Therefore, MuRP first embeds the knowledge graph in the hyperbolic space, hoping to obtain a more accurate spatial structure embedding from a global perspective. Unlike the previous use of fixed curvature values, ATTH can adaptively obtain the spatial characteristics of hierarchical and logical patterns by learning the curvature of the space. HEB breaks through the original rectangular coordinate system and further models the hierarchical structure of the knowledge graph by mapping the Poincare disk on the polar coordinate system. HyperKA is the first KGE method that combines hyperbolic manifold space with graph neural network. In order to further improve the representation ability of manifold space on the knowledge graph, UltraE uses the hyperbolic manifold space to model the nodes of the knowledge graph from a global perspective.
[0090] On the other hand, local perspective methods, such as graph neural networks (GNNs), enrich the representation of entities by aggregating information from neighboring nodes, and can better capture local context information. However, such methods often ignore the global structure of the knowledge graph, resulting in the lack of global consistency in the embedding results, which affects the performance of subsequent tasks.
[0091] Specifically, unlike the traditional knowledge graph embedding algorithms mentioned above that use a single transformation type, 5*E introduces a projective geometric mapping that supports multiple transformations to adaptively obtain local structural features. In manifold geometry, Albert Gu et al. proposed in 2018 to learn embedding in the direct product space of multiple manifold spaces (spherical space, hyperbolic space, and Euclidean space) and heuristically evaluate the spatial curvature required for local graph data. DGS noticed the difference between the knowledge graph structure under the entity perspective and the ontology perspective, and proposed a carefully designed multi-manifold space to embed the knowledge graph structure in a fine-grained manner. The AMCAD method uses a mixed curvature space to embed the knowledge graph, while the M 2 GNN further introduces graph neural network to extract environmental information and local spatial information from a local perspective. GIE models the structure of the knowledge graph from a local perspective through an attention-based geometric interaction module. FieldE uses first-order differential equations to model the local structure of data.
[0092] Existing knowledge graph embedding methods only consider the spatial characteristics of knowledge graphs from a single perspective, either global or local. As a result, the learned knowledge graph embeddings are biased and inaccurate.
[0093] Based on this, the embodiments of the present application provide a dual-perspective knowledge graph learning embedding method, device, electronic device and medium, aiming to model the embedding of entities from both global and local perspectives, so as to learn a more accurate knowledge graph representation.
[0094] The learning embedding method of the dual-perspective knowledge graph provided in the embodiment of the present application can be applied to the terminal, can also be applied to the server side, and can also be software running in the terminal or the server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the learning embedding method of the dual-perspective knowledge graph, etc., but is not limited to the above forms.
[0095] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0096] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0097] Figure 1 is an optional flowchart of the learning embedding method of the dual-view knowledge graph provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S110 to S150.
[0098] Step S110, obtaining urban road data and road flow speed data, and constructing an initial knowledge graph based on the urban road data and road flow speed data.
[0099] Step S120, determining the triples to be evaluated based on the entities corresponding to the urban roads in the initial knowledge graph and the relationships between the entities.
[0100] Step S130, performing global mapping conversion processing on the entity embedding features of the triplet to obtain entity global features.
[0101] Step S140 , performing local mapping conversion processing on the entity global feature to obtain entity hyperspherical feature, entity hyperbolic feature and entity Euclidean feature respectively.
[0102] Step S150, inputting entity global features, entity hyperspherical features, entity hyperbolic features and entity Euclidean features into an attention fusion model to obtain entity fusion features.
[0103] Step S160, obtaining a score value for the triplet according to the entity global feature and the entity fusion feature.
[0104] Step S170, update the relationship between entities in the initial knowledge graph according to the scoring values to obtain the target knowledge graph.
[0105] In step S110, an initial knowledge graph is constructed based on the urban road data and the road flow speed data. The entities in the knowledge graph may include different types of roads, traffic nodes, regions, etc. The relationships between entities may involve various types, such as direct connection, indirect connection, flow speed relationship, flow direction relationship, etc. Since the road flow speed data changes over time, the initial knowledge graph may contain timestamps or time intervals to reflect the dynamic changes in road conditions. The specific structural form of the knowledge graph is not limited in this application.
[0106] In step S160, a weight can be assigned to the head entity global feature, the tail entity global feature, the head entity fusion feature and the tail entity fusion feature, respectively, and each feature is multiplied by its corresponding weight, and then all weighted feature values are added to obtain the score value of the triple. Similarity or distance measurement methods can also be used to evaluate the similarity or difference between the head entity and the tail entity in their respective feature spaces. In addition, a neural network model can also be designed, using the four features as input, and performing nonlinear transformation and combination of features through multiple hidden layers within the network. In the output layer of the network, one or more neurons are used to calculate the score value of the triple. This is not limited in the present application.
[0107] In step S130, the entity embedding feature is globally mapped and converted to obtain the entity global feature. The entity global feature mainly focuses on analyzing the overall position and relationship of the entity in the knowledge graph. Specifically, it takes into account factors such as the connection between the entity and other entities, the hierarchical structure of the entity, and the importance of the entity in the global environment.
[0108] In step S140, the entity global features are subjected to local mapping conversion processing to obtain entity hypersphere features, entity hyperbolic features and entity Euclidean features respectively. Among them, the entity hypersphere feature is used to capture the distribution and shape information of the entity in space. In the urban road traffic assessment, the entity hypersphere feature can be used, but not limited to, to represent the distribution of traffic flow in different time periods or different sections, or to describe the diffusion range and impact of traffic events. Through the hypersphere feature, the state and change of the entity in space can be more intuitively understood. The entity hyperbolic feature uses the characteristics of hyperbolic space to capture the complex relationship between entities. The hyperbolic space has advantages in representing data with hierarchical structure and power law distribution. In the urban road traffic assessment, the hyperbolic feature may be used to represent the hierarchical structure of the road network, the nonlinear change of traffic flow and other complex relationships. The entity hyperbolic feature can reveal the deep information hidden behind the data. The entity Euclidean feature captures the similarities and differences between entities based on metrics such as distance and angle in Euclidean space. In urban road traffic assessment, Euclidean features may be used to represent the similarity of traffic flows between different road sections, the correlation between different traffic events, etc. Through Euclidean features, entities can be quantitatively compared and analyzed.
[0109] In step S130 to step S150, the entity global features, entity hyperspherical features, entity hyperbolic features and entity Euclidean features of the dual-view analysis method together constitute a comprehensive and in-depth representation of the entity, providing strong support for complex tasks such as urban road flow assessment.
[0110] Steps S110 to S170 shown in the embodiment of the present application, by acquiring urban road data and road flow speed data, and forming an initial knowledge graph, select or generate a series of triples to be evaluated from the initial knowledge graph according to the entities corresponding to the pre-evaluated urban roads in the initial knowledge graph, and these triples represent key information points or potential relationships in the knowledge graph. Subsequently, the entity embedding features of the triples are processed by a dual-perspective analysis method, specifically, the entity embedding features are globally mapped and transformed to obtain entity global features. The global features are further converted into a variety of local features (hypersphere features, hyperbolic features, Euclidean features) to capture local information from different perspectives, and the attention fusion model is used to fuse a variety of local features to obtain entity fusion features. Then, the score value of the triple is calculated using the entity global features and entity fusion features obtained above, which reflects the rationality and importance of the triple in the knowledge graph. The score value not only takes into account the global position and relationship of the entity, but also incorporates rich local detail information, making the scoring result more accurate and reliable. According to the score value, the relationship between entities in the initial knowledge graph triples is screened, adjusted or added to optimize the structure and content of the knowledge graph to obtain a more complete and accurate target knowledge graph. The present invention uses Riemann manifold spaces of various curvature types (hyperbolic space, hyperspherical space and Euclidean space) to model the embedding of entities from both global and local perspectives, thereby learning a more accurate knowledge graph representation.
[0111] Reference Figure 2 It can be understood that in step S130, the steps are specifically as follows:
[0112] Step S210: Input the entity embedding features of the triplet into the first mapping model that maps the preset Euclidean space to the hyperbolic space to obtain the entity global features; wherein the entity embedding features include the head entity embedding features and the tail entity embedding features, and the entity global features include the head entity global features and the tail entity global features.
[0113] Among them, the first mapping model is:
[0114]
[0115] Among them, e H is the entity global feature, is the first mapping model, c represents the space curvature, v represents the entity embedding feature, is the Möbius addition, ‖·‖2 represents the second mode of the vector, x is the mapping horizontal coordinate, x=0, which represents the mapping relationship at the origin.
[0116] In step S210, the first mapping model from Euclidean space to hyperbolic space is used to calculate the entity global features in order to fully utilize the unique advantages of hyperbolic space in processing data with hierarchical structure, power law distribution or nonlinear relationship, so as to more comprehensively capture the features of the entity from a global perspective. The first mapping model not only improves the accuracy and comprehensiveness of entity representation, but also provides strong support for subsequent tasks (such as scoring, prediction, etc.).
[0117] Continue to refer to Figure 2 It is understood that, in the present application, it is assumed that the local space of the Riemann manifold is flat, so the local space of the entity global feature in the hyperbolic space can be approximately regarded as being in the Euclidean space. Further, in step S140, the following steps may be included but not limited to:
[0118] Step S310: inputting the entity global feature into a preset second mapping model from Euclidean space to hypersphere space to obtain the entity hypersphere feature; wherein the entity hypersphere feature includes the head entity hypersphere feature and the tail entity hypersphere feature.
[0119] Among them, the second mapping model is:
[0120]
[0121] in, is the solid hypersphere feature, is the second mapping model, x=0.
[0122] Step S320: inputting the entity global features into a preset third mapping model from Euclidean space to hyperbolic space to obtain entity hyperbolic features; wherein the entity hyperbolic features include head entity hyperbolic features and tail entity hyperbolic features.
[0123] Among them, the third mapping model is:
[0124]
[0125] in, is the hyperbolic feature of the entity, is the third mapping model, x=0;
[0126] Step S330: taking the entity global features as entity Euclidean features; wherein the entity Euclidean features include the head entity Euclidean features and the tail entity Euclidean features.
[0127] In step S310 to step S330, the Riemann manifold is a smooth manifold with a metric tensor, which allows us to define concepts such as length, angle, and inner product at each point of the manifold. Therefore, in the Riemann manifold, the local space (i.e., a small neighborhood on the manifold) can be approximated as a Euclidean space, which means that the curvature of the manifold can be ignored in this local area, or more specifically, the metric tensor of the manifold is very close to the metric tensor of the Euclidean space in this area, and the global features of entities defined in the hyperbolic space, when restricted to the local space, can be approximately regarded as defined in the Euclidean space, that is, the tools and concepts of Euclidean geometry can be used to analyze and process these features. Therefore, in this step, the global features are converted into a variety of local features (hypersphere features, hyperbolic features, Euclidean features) to capture local information from different perspectives, providing strong support for complex tasks such as urban road traffic assessment.
[0128] Reference Figure 3 It is understandable that, in step S134, the following steps may be included but not limited to:
[0129] Step S410: Obtaining a preset rotation transformation matrix and translation transformation parameters;
[0130] Step S420: performing rotation and translation processing on the entity hypersphere feature, the entity hyperbolic feature and the entity Euclidean feature according to the rotation transformation matrix and the translation transformation parameter, to obtain a first hypersphere feature, a first hyperbolic feature and a first Euclidean feature respectively;
[0131] Step S430: inputting the entity global feature, the first hypersphere feature, the first hyperbolic feature and the first Euclidean feature into the attention fusion model to obtain the entity fusion feature; wherein the entity fusion feature includes the head entity fusion feature and the tail entity fusion feature.
[0132] In step S410 to step S430, different spatial representations may have different intrinsic structures and metrics. Through rotation and translation processing, these features can be aligned and standardized to a certain extent, so that they have better consistency and comparability when input into the attention fusion model. This helps the model to better understand and utilize these feature information from different spaces, thereby improving the fusion effect. Through rotation and translation processing, the information loss caused by the mismatch between features in direct fusion is reduced, and this mismatch can be reduced to a certain extent, retaining more original feature information, and maintaining the accuracy and robustness of the model.
[0133] Specifically, in step S310 to step S330, the entity hypersphere features are obtained respectively Solid Hyperbolic Features and the Euclidean characteristics of entities In step S410 to step S430, the geometric transformation is composed of a rotation transformation and a translation transformation. For any entity embedding e∈R n , the result after geometric transformation is Where R is the general rotation transformation matrix and v is the translation transformation parameter. Then, by performing the above geometric transformation on each entity in the space, the first hypersphere feature is obtained. First hyperbolic characteristic and the first Euclidean characteristic
[0134] Reference Figure 4 It is understandable that step S430 may include but is not limited to the following steps:
[0135] Step S510: Obtain a preset attention vector;
[0136] Step S520: Calculate a first attention score for the first hypersphere feature, a second attention score for the first hyperbolic feature, and a third attention score for the first Euclidean feature according to the entity global feature, the first hypersphere feature, the first hyperbolic feature, the first Euclidean feature, and the attention vector;
[0137] Step S530: Obtain entity fusion features according to the product of the first attention score and the first hypersphere feature, the product of the second attention score and the first hyperbolic feature, and the product of the third attention score and the first Euclidean feature.
[0138] In steps S510 to S530, the attention mechanism allows the model to automatically learn and distinguish the importance of different features. During the fusion process, important features will be given higher weights, while less important features will be relatively weakened. This mechanism helps the model pay more attention to features that contribute more to the task objectives, thereby improving overall performance.
[0139] In addition, the attention vector is a predefined parameter vector used to calculate the weights of different features in the attention mechanism. It can be randomly initialized and updated through backpropagation during model training. Using some form of attention mechanism (such as dot product attention, additive attention, etc.), the global features of the entity, the features of each geometric space (first hypersphere feature, first hyperbolic feature, first Euclidean feature) and the attention vector are taken as input. Through the operation of the attention mechanism, an attention score is calculated for each feature of the geometric space. This score reflects the importance of the feature in the current task. Specifically, the calculation of the attention score may involve some form of interaction between the attention vector and the representation of each feature (such as dot product, concatenation and passing through a neural network layer, etc.), and then normalizing the score through a nonlinear function (such as softmax) so that the sum of the attention scores of all features is 1. The attention vector λ is introduced to calculate the corresponding attention score for the entity in each space, as shown below
[0140]
[0141] Among them, λ S , H and λ E They are the first attention score, the second attention score, and the third attention score respectively.
[0142] Among them, the global embedding and the local embedding are connected using the "splicing" operator, so that the local spatial features of multiple spaces can be jointly considered from dual perspectives (global and local), thereby achieving better fusion. Finally, the attention score of each space is calculated. Finally, the weighted sum is used to obtain the fused entity embedding, as shown below:
[0143]
[0144] in, It is the entity fusion feature.
[0145] Reference Figure 5 It can be understood that the entity global feature includes the head entity global feature and the tail entity global feature, and the entity fusion feature includes the head entity fusion feature and the tail entity fusion feature. In step S160, the following steps may be included but not limited to:
[0146] Step S610: Obtain a first predicted distance value according to the global features of the head entity and the fusion features of the tail entity;
[0147] Step S620: Obtain a second predicted distance value according to the global features of the tail entity and the fusion features of the head entity;
[0148] Step S630: Obtain a score value for the triple according to the first predicted distance value and the second predicted distance value.
[0149] In step S610 to step S630, by simultaneously considering the global features and fusion features of the head entity and the tail entity, not only the global perspective between entities is considered, but also the potential relationship or high-order dependency between entities is captured through the fusion features, so that the model can better handle complex relationship modeling problems, such as many-to-many relationships, hierarchical relationships, etc. The first predicted distance value and the second predicted distance value are subjected to some form of comprehensive processing, such as weighted summation, averaging, maximum / minimum selection, etc., to obtain the final score value for the triple. This score value reflects the overall matching degree and credibility of the head entity and the tail entity under a given relationship.
[0150] In step S610, the following technical features may be included but not limited to:
[0151] According to the global features of the head entity and the fusion features of the tail entity, a first predicted distance value is calculated by a preset distance prediction formula;
[0152] Among them, the distance prediction formula is:
[0153]
[0154] in, represents the first predicted distance value, is the tail entity fusion feature, h H is the global feature of the head entity, c represents the spatial curvature, is the Möbius addition, and ‖·‖2 represents the second modulus of the vector.
[0155] Similarly, in step S620, the formula for calculating the second predicted distance value is:
[0156]
[0157] in, represents the first predicted distance value, is the head entity fusion feature, t H It is the global feature of the tail entity.
[0158] In step S630, the following steps may be included but not limited to:
[0159] According to the first predicted distance value and the second predicted distance value, a score value about the triple is calculated by a preset evaluation model;
[0160] The evaluation model is:
[0161] Φ(h,r,t)=-(dist(h~ H,t H )+dist(t~ H ,h H ))+b;
[0162] Among them, Φ(h, r, t) represents the score value of the triple, and b is the score compensation value.
[0163] The score reflects the overall matching and credibility of the head entity and the tail entity under a given relationship, that is, the overall matching and credibility of the triple to be evaluated. In the above formula, the sum of the distance between the predicted head entity and the tail entity and the distance between the predicted tail entity and the head entity is calculated as the score of the triple, so the closer the distance, the higher the score.
[0164] Reference Figure 6 It is understandable that after step S170, the following steps may also be included but not limited to:
[0165] Step S710: Obtain training triples from the target knowledge graph.
[0166] Step S720: Obtaining a training score value for the training triplet according to the training triplet;
[0167] Step S730: input the training triplet into the urban road flow assessment model to obtain training output features;
[0168] Step S740: Calculate the loss value according to the training triples, the training output features and the training score values;
[0169] Step S750: Optimize the parameters of the urban road flow assessment model according to the loss value until the loss value meets the preset conditions.
[0170] In step S710 to step S750, a certain number of triples are selected as training triples in the updated target knowledge graph, and the above training triples contain sufficient diversity to cover multiple aspects of urban road traffic evaluation. The training triples are scored through the above step S140, and the score value can reflect the confidence of the training triples for model training, which can be used as a reference for subsequent model training. The selected training triples are passed as input data to the constructed urban road traffic evaluation model. The model calculates the corresponding output features based on the input triple information through internal algorithms and parameters. A loss value is calculated using the training score value, the training output features and the information of the training triples themselves. This loss value measures the difference between the model output and the expected output. According to the calculated loss value, the internal parameters of the urban road traffic evaluation model are adjusted using optimization algorithms such as back propagation. Repeat the above steps, that is, continuously obtain new training triples from the target knowledge graph, calculate the training score value, input the model to obtain the output, calculate the loss value, and optimize the model parameters. This process will continue until the loss value meets the preset conditions, such as reaching a certain threshold, the loss value no longer decreases significantly, etc., indicating that the urban road traffic evaluation model has been trained to a certain level of accuracy.
[0171] The present invention is mainly in the field of knowledge graph completion and characterization. Since the knowledge graph data of the real world often has the problem of incompleteness, that is, the description of the real world by the knowledge graph data is missing. In order to solve this problem, we can use the present invention to first map the entities and relationship edges in the knowledge graph to a low-dimensional Euclidean vector space, and then use the scoring function of the present invention to calculate the scores of all possible triples in the graph, and sort them according to the scores. Then we count the scores of triples that actually exist but do not exist in the observed knowledge graph data in all scoring rankings. Through testing, we found that in the WN18RR dataset, the probability of a real but unobserved triple ranking in the top ten is 58.1%, in the FB15K-237 dataset, the probability of ranking in the top ten is 55.7%, and in the YAGO3-10 dataset, the probability of ranking in the top ten is 71.3%. The present invention uses Riemannian manifold spaces of different curvature types (hyperbolic space, hyperspherical space and Euclidean space) to model the embedding of entities from both global and local perspectives, thereby learning a more accurate knowledge graph representation. At the same time, a geometric attention module is also introduced, which can effectively fuse multiple heterogeneous spaces by combining the attention mechanism of global and local perspectives, thereby learning a more appropriate entity representation.
[0172] See also Figure 7The embodiment of the present application further provides a dual-view knowledge graph learning embedding device 700, which can implement the dual-view knowledge graph learning embedding method, and the device includes:
[0173] An acquisition module 710 is used to acquire urban road data and road flow speed data, and construct an initial knowledge graph based on the urban road data and road flow speed data;
[0174] A determination module 720 is used to determine the triples to be evaluated according to the entities corresponding to the urban roads in the initial knowledge graph and the relationships between the entities;
[0175] The global mapping module 730 is used to perform local mapping conversion processing on the entity global features to obtain entity hyperspherical features, entity hyperbolic features and entity Euclidean features respectively;
[0176] The local mapping module 740 is used to perform local mapping conversion processing on the entity global features to obtain entity hyperspherical features, entity hyperbolic features and entity Euclidean features respectively;
[0177] A fusion module 750 is used to input entity global features, entity hyperspherical features, entity hyperbolic features and entity Euclidean features into an attention fusion model to obtain entity fusion features;
[0178] A scoring module 760, used to obtain a scoring value for a triple according to the entity global feature and the entity fusion feature;
[0179] The updating module 770 is used to update the initial knowledge graph according to the scoring value to obtain the target knowledge graph.
[0180] The specific implementation of the dual-perspective knowledge graph learning embedding device is basically the same as the specific implementation of the dual-perspective knowledge graph learning embedding method mentioned above, and will not be repeated here.
[0181] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned dual-view knowledge graph learning embedding method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0182] See also Figure 8 , Figure 8 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0183] The processor 801 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0184] The memory 802 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 802 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 802, and the processor 801 calls and executes the learning embedding method of the dual-view knowledge graph in the embodiment of this application;
[0185] Input / output interface 803, used to implement information input and output;
[0186] The communication interface 804 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WI FI, Bluetooth, etc.);
[0187] A bus 805 that transmits information between the various components of the device (e.g., the processor 801, the memory 802, the input / output interface 803, and the communication interface 804);
[0188] The processor 801 , the memory 802 , the input / output interface 803 and the communication interface 804 are connected to each other in communication within the device via a bus 805 .
[0189] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, it implements the above-mentioned dual-perspective knowledge graph learning embedding method.
[0190] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0191] The learning embedding method, device, electronic device and storage medium of the dual-view knowledge graph provided in the embodiment of the present application obtain urban road data and road flow speed data, and form an initial knowledge graph. According to the entities corresponding to the pre-evaluated urban roads in the initial knowledge graph, a series of triples to be evaluated are selected or generated from the initial knowledge graph. These triples represent key information points or potential relationships in the knowledge graph. Subsequently, the entity embedding features of the triples are processed by a dual-view analysis method, specifically, the entity embedding features are globally mapped and transformed to obtain entity global features. The global features are further converted into a variety of local features (hypersphere features, hyperbolic features, Euclidean features) to capture local information from different perspectives, and the attention fusion model is used to fuse the various local features to obtain entity fusion features. Then, the score value of the triple is calculated using the entity global features and entity fusion features obtained above, which reflects the rationality and importance of the triple in the knowledge graph. The score value not only considers the global position and relationship of the entity, but also incorporates rich local detail information, making the scoring result more accurate and reliable. According to the score value, the relationship between entities in the initial knowledge graph triples is screened, adjusted or added to optimize the structure and content of the knowledge graph to obtain a more complete and accurate target knowledge graph. The present invention uses Riemann manifold spaces of various curvature types (hyperbolic space, hyperspherical space and Euclidean space) to model the embedding of entities from both global and local perspectives, thereby learning a more accurate knowledge graph representation.
[0192] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0193] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0194] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0195] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0196] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0197] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0198] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0199] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0200] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0201] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0202] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A learning embedding method for a dual-view knowledge graph, characterized in that: The method comprises: Acquire urban road data and road flow speed data, and construct an initial knowledge graph based on the urban road data and the road flow speed data; Determine a triple to be evaluated according to entities corresponding to each urban road in the initial knowledge graph and the relationship between the entities; Performing global mapping conversion processing on the entity embedding features of the triples to obtain entity global features; Performing local mapping conversion processing on the entity global features to obtain entity hyperspherical features, entity hyperbolic features and entity Euclidean features respectively; Inputting the entity global feature, the entity hyperspherical feature, the entity hyperbolic feature and the entity Euclidean feature into an attention fusion model to obtain an entity fusion feature; Obtaining a score value for the triple according to the entity global feature and the entity fusion feature; The relationships between entities in the initial knowledge graph are updated according to the scoring values to obtain a target knowledge graph.
2. The learning embedding method of dual-view knowledge graph according to claim 1 is characterized in that: The performing global mapping conversion processing on the entity embedding features of the triples to obtain entity global features includes: Inputting the entity embedding features of the triple into a first mapping model of a preset Euclidean space to a hyperbolic space to obtain entity global features; wherein the entity embedding features include a head entity embedding feature and a tail entity embedding feature, and the entity global features include a head entity global feature and a tail entity global feature; Wherein, the first mapping model is: Among them, e H is the entity global feature, is the first mapping model, c represents the space curvature, v represents the entity embedding feature, is the Möbius addition, ‖·‖2 represents the second mode of the vector, x is the mapping horizontal coordinate, and x=0.
3. The learning embedding method of dual-view knowledge graph according to claim 2 is characterized in that: The local mapping conversion process is performed on the entity global feature to obtain the entity hyperspherical feature, entity hyperbolic feature and entity Euclidean feature respectively, including: Inputting the entity global feature into a preset second mapping model from Euclidean space to hypersphere space to obtain entity hypersphere feature; wherein the entity hypersphere feature includes a head entity hypersphere feature and a tail entity hypersphere feature; Wherein, the second mapping model is: in, is the solid hypersphere feature, is the second mapping model, x=0; Inputting the entity global feature into a third mapping model that maps a preset Euclidean space to a hyperbolic space to obtain an entity hyperbolic feature; wherein the entity hyperbolic feature includes a head entity hyperbolic feature and a tail entity hyperbolic feature; Wherein, the third mapping model is: in, is the hyperbolic feature of the entity, is the third mapping model, x=0; The entity global feature is used as an entity Euclidean feature; wherein the entity Euclidean feature includes a head entity Euclidean feature and a tail entity Euclidean feature.
4. The learning embedding method of dual-view knowledge graph according to claim 1 is characterized in that: The step of inputting the entity global feature, the entity hypersphere feature, the entity hyperbolic feature and the entity Euclidean feature into the attention fusion model to obtain the entity fusion feature includes: Get the preset rotation transformation matrix and translation transformation parameters; According to the rotation transformation matrix and the translation transformation parameter, the entity hypersphere feature, the entity hyperbolic feature and the entity Euclidean feature are subjected to rotation and translation processing to obtain a first hypersphere feature, a first hyperbolic feature and a first Euclidean feature respectively; The entity global feature, the first hypersphere feature, the first hyperbolic feature and the first Euclidean feature are input into an attention fusion model to obtain an entity fusion feature; wherein the entity fusion feature includes a head entity fusion feature and a tail entity fusion feature.
5. The learning embedding method of dual-view knowledge graph according to claim 4 is characterized in that: The step of inputting the entity global feature, the first hypersphere feature, the first hyperbolic feature and the first Euclidean feature into the attention fusion model to obtain the entity fusion feature comprises: Get the preset attention vector; According to the entity global feature, the first hypersphere feature, the first hyperbolic feature, the first Euclidean feature and the attention vector, a first attention score about the first hypersphere feature, a second attention score about the first hyperbolic feature and a third attention score about the first Euclidean feature are calculated; An entity fusion feature is obtained according to the product of the first attention score and the first hypersphere feature, the product of the second attention score and the first hyperbolic feature, and the product of the third attention score and the first Euclidean feature.
6. The learning embedding method of dual-view knowledge graph according to claim 1 is characterized in that: The entity global features include a head entity global feature and a tail entity global feature, and the entity fusion features include a head entity fusion feature and a tail entity fusion feature; The step of obtaining a score value for the triplet according to the entity global feature and the entity fusion feature includes: Obtaining a first predicted distance value according to the head entity global feature and the tail entity fusion feature; Obtaining a second predicted distance value according to the tail entity global feature and the head entity fusion feature; A score value for the triple is obtained according to the first predicted distance value and the second predicted distance value.
7. The learning embedding method of dual-view knowledge graph according to claim 6 is characterized in that: The obtaining a first predicted distance value according to the head entity global feature and the tail entity fusion feature includes: According to the global features of the head entity and the fusion features of the tail entity, a first predicted distance value is calculated by a preset distance prediction formula; Wherein, the distance prediction formula is: in, represents the first predicted distance value, is the tail entity fusion feature, h H is the global feature of the head entity, c represents the spatial curvature, is the Möbius addition, ‖·‖2 represents the second modulus of the vector; The step of obtaining a score value for the triplet according to the first predicted distance value and the second predicted distance value includes: According to the first predicted distance value and the second predicted distance value, a score value for the triplet is calculated by a preset evaluation model; Wherein, the evaluation model is: Among them, Φ(h,r,t) represents the score value of the triple, represents the second predicted distance value, and b is the score compensation value.
8. The learning embedding method of dual-view knowledge graph according to claim 1, characterized in that: After the step of updating the relationship between entities in the initial knowledge graph according to the scoring values to obtain the target knowledge graph, the method further includes: Obtaining training triples from the target knowledge graph; According to the training triples, obtaining a training score value for the training triples; Inputting the training triplet into a preset urban road traffic flow assessment model to obtain training output features; Calculate a loss value according to the training triplet, the training output feature and the training score value; The parameters of the urban road flow assessment model are optimized according to the loss value until the loss value meets the preset conditions.
9. A dual-view knowledge graph learning embedding device, characterized in that: The device comprises: An acquisition module, used to acquire urban road data and road flow speed data, and construct an initial knowledge graph based on the urban road data and the road flow speed data; A determination module, used to determine the triples to be evaluated according to the entities corresponding to the urban roads in the initial knowledge graph and the relationships between the entities; A global mapping module, used for performing global mapping conversion processing on the entity embedding features of the triplet to obtain entity global features; A local mapping module is used to perform local mapping conversion processing on the entity global feature to obtain entity hyperspherical feature, entity hyperbolic feature and entity Euclidean feature respectively; A fusion module, used for inputting the entity global feature, the entity hyperspherical feature, the entity hyperbolic feature and the entity Euclidean feature into an attention fusion model to obtain an entity fusion feature; A scoring module, used for obtaining a scoring value for the triplet according to the entity global feature and the entity fusion feature; An updating module is used to update the initial knowledge graph according to the scoring value to obtain a target knowledge graph.
10. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the learning embedding method of the dual-view knowledge graph described in any one of claims 1 to 8 when executing the computer program.
11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the learning embedding method of the dual-view knowledge graph described in any one of claims 1 to 8.
Citation Information
Patent Citations
Knowledge graph representation learning method for distinguishing data types in hyperbolic space
CN113673703A
Multi-source information fusion enhanced knowledge graph representation learning method
CN115563314A
Network attack event tracing method and device based on hyperboloid embedding representation technology
CN115858806A
Knowledge graph embedding method and model based on hierarchical relation rotation and entity rotation
CN116306936A
Multi-information perception knowledge graph entity alignment method
CN117150036A
Cited By
Cross-platform business system integration method based on knowledge graph
CN121579702A
A knowledge graph-based cross-platform business system integration method
CN121579702B