Geographic knowledge graph implicit reasoning model construction method considering time period characteristics

By designing an implicit inference model of geographic knowledge graphs that take into account time period characteristics, the encoding of time points and time periods is uniformly processed, the problem of insufficient time period feature extraction capability is solved, and the performance of geographic logic query is improved.

CN118982071AActive Publication Date: 2024-11-19HEFEI UNIV OF TECH
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411075181.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-11-19
Estimated Expiration
2044-08-07

AI Technical Summary

Technical Problem

The prior art has shortcomings in encoding and extracting time period features, ignoring the multi-dimensional information within the time period, resulting in weak encoding and extraction capabilities of time period features, affecting the performance of geographic logic query.

Method used

A geographic knowledge graph implicit reasoning model that takes into account the characteristics of time periods was designed. Through a multi-scale time period encoder, including time scale adjustment, periodic encoding and time period span encoding, the encoding of time points and time periods was uniformly processed, and the encoding of time points and time periods was constructed. Entity encoder and projection operator, combined with intersection operator for inference.

Benefits of technology

It improves the extraction ability of time period features, improves the performance of geographic logic query and answers, solves the problem of insufficient encoding and extraction capabilities of time period features, and enhances the processing ability of multi-scale time information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118982071A_ABST
    Figure CN118982071A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of geographic knowledge graph embedding, and particularly discloses a geographic knowledge graph implicit reasoning model construction method considering time period characteristics, which comprises the following steps of: firstly, constructing a multi-scale geological sample data set; then establishing an implicit reasoning model considering time period characteristics; and finally, evaluating the performance of the model through evaluation indexes and analysis experiment results. According to the geographic knowledge map implicit reasoning model construction method considering the time period characteristics, the time period coding-oriented geographic logic query question and answer is constructed aiming at the problem that the time period characteristic extraction capability of an existing time encoder is insufficient. The limitation of an existing time encoder on time period information and multi-scale time information processing is solved, the time period encoder oriented to time period features is constructed, and the effectiveness of the time period encoder and the performance of the time period encoder in downstream tasks are verified by adopting a geological sample data set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of geographic knowledge graph embedding technology, and in particular to a method for constructing an implicit reasoning model of a geographic knowledge graph taking into account time period characteristics. Background Art

[0002] Geographic knowledge graph introduces the concept of knowledge graph into the organization and analysis of geographic information, and expresses geographic entities and their related attributes and spatial relationships through structured methods such as time and location, which greatly enriches the expression and application of geographic information. Many geographic entities and events have significant spatiotemporal characteristics. For example, the changes in administrative regions in urban development and the spatiotemporal evolution of landslide events are inseparable from the accurate description of time and space. The geographic logical query task based on knowledge graph uses a large amount of structured information stored in the knowledge graph and geographic related information such as location and time to solve geographic query and reasoning problems. Time has different expressions, and the encoding of time information has a certain complexity. Different time encoding methods may directly affect the performance of downstream tasks. At present, there are relatively few studies on encoding time information and applying it in geographic knowledge graph query tasks. Therefore, how to effectively construct a time encoder to extract time features and apply it to downstream tasks such as knowledge graph geographic logical query is still a major challenge.

[0003] In the study of encoding and feature extraction of temporal information, the dimensionality reduction method that simplifies the time period into a single time point ignores the rich information contained in the time period, including the duration of time, multi-scale temporal information, and possible changes or state transitions within it. The main difference between a time point and a time period is the difference in the dimension and magnitude of the information they contain. A time point can be considered as an instantaneous moment, while a time period represents a continuous interval, including the start time, the end time, and all the moments in between. In addition, a time period may also contain temporal features such as duration. When encoding a time period, it is necessary to consider not only the encoding of the time point, but also the length and span of the time period. Therefore, a new time period encoding method is urgently needed to solve the problem that the current time encoder is insufficient in encoding and extracting time period features. Summary of the invention

[0004] The purpose of the present invention is to provide a method for constructing an implicit reasoning model of a geographic knowledge graph that takes into account time period characteristics, thereby fully utilizing the information within the time period by retaining the multi-dimensional characteristics of the time period, improving the ability to extract time period characteristics, and improving the performance of geographic logical query and answering.

[0005] To achieve the above object, the present invention provides a method for constructing an implicit reasoning model of a geographic knowledge graph taking into account time period characteristics, comprising the following steps:

[0006] S1. Construct a multi-scale geological sample dataset;

[0007] S2, establish an implicit reasoning model that takes into account the characteristics of the time period;

[0008] S3. Evaluate the model performance by evaluating indicators and analyzing experimental results.

[0009] Preferably, step S1 specifically includes the following steps:

[0010] S11. Data source:

[0011] The geological sample dataset contains different geological sample data. Each record reflects the lithology code, lithology number and specific geographical location of the sample, including the continent, country and longitude and latitude of the sample, as well as notes related to its geographical location.

[0012] For each sample, a geological time interpretation algorithm is used to obtain the geological age map referenced by the geological sample and the specific start time, end time and corresponding uncertainty;

[0013] S12. Data preprocessing:

[0014] Each sample in the geological sample data set records the corresponding time information: the geological age of the sample represented by the Start and End columns and the time in the PrimaryReference column. The specific process of data preprocessing includes:

[0015] Convert the data in the Start and End columns to a common year format and expression. The time unit in the Start and End columns is millions of years ago Ma. Multiply the data by -1*10 6 ;

[0016] For the time in the PrimaryReference column, use a regular expression to extract the year in the column. After extracting all the time, convert it into a common expression of year, month, day, hour, minute, and second.

[0017] Assign a unique ID to each record by creating an increasing integer sequence NewIDNumber, which serves as the sample name to connect the geographic location, time information, and lithology description;

[0018] S13. Knowledge graph construction:

[0019] Determine the relationship between entities in the knowledge graph, and convert the triples into nodes and edges in the graph by specifying the relationship between entities in each column; complete the attribute assignment of sample nodes by normalizing time labels and mapping geographic coordinates;

[0020] S14. Question and answer dataset construction:

[0021] The triplets in the knowledge graph are divided into training set, test set and validation set in a ratio of 90:9:1. After sampling, the query and answer pairs of the geological sample dataset are constructed. QA .

[0022] Preferably, step S2 specifically includes the following steps:

[0023] S21. Design a temporal encoder Enc for time segment features (p) ();

[0024] Encode time periods with complex time attributes. Time period features include start time, end time, span, and periodicity. Time points are regarded as special time periods, that is, the start time of a time period is equal to the end time. For time information of both time points and time periods, time points are expressed in the form of time periods, that is, dimensionality is increased.

[0025] The feature extraction and combination of time periods will be considered from three aspects: time scale adjustment, periodicity coding and time period span coding;

[0026] S22. Construct an implicit reasoning model of geographic knowledge graph that takes into account the characteristics of time periods;

[0027] Implicit reasoning model of geographic knowledge graph considering time period characteristics TFKGE period It includes three parts: entity encoder, projection operator and intersection operator. The entity encoder consists of entity feature encoder and time period feature encoder, which encode the entity features and time period features of the knowledge graph respectively, and then combine them into an entity vector containing time period features. The projection operator is used to calculate the projection of the entity vector on the relationship vector to obtain the result vector, and the intersection operator is used to calculate multiple result vectors to obtain the final target vector. Finally, the target node to be inferred is obtained through the nearest neighbor search.

[0028] S23, model training;

[0029] Training TFKGE on a newly constructed geological sample dataset period The model and multiple parameter models are then compared with the baseline model on the Yago15k dataset to test TFKGE period The model's contribution to geographic logical question answering tasks.

[0030] Preferably, in step S21, the specific process of adjusting the time scale is as follows:

[0031] By applying different logarithmic functions to the time values ​​to reduce the scale of the start and end times, two time scaling functions S(t) are defined:

[0032] The first order of magnitude scaling method based on logarithmic adjustment S (l) (t), the specific process is as follows:

[0033] First, a logarithmic function is used to determine a benchmark value, and then all data are scaled according to this benchmark value to retain the relative size relationship of the original data; by combining logarithmic transformation and order of magnitude scaling, the order of magnitude differences that may be caused by cross-scale time data when input into the deep learning model are reduced:

[0034]

[0035] in, Indicates the rounding down operation, t min Indicates the minimum time value in the data set or a manually specified reference value;

[0036] The second absolute value logarithmic transformation method S (k) (t), the specific process is as follows:

[0037] By using the absolute value of |t|, we ensure that even if t is negative, |t|+c is positive, so that the function value is within the domain of definition, and the logarithmic transformation log k , the time data is mapped to a new scale:

[0038] S (k) (t) = log k (|t|+c) (2)

[0039] Here, k and c are adjusted parameters that control the degree of scaling and offset.

[0040] Preferably, in step S21, the periodic encoding is specifically:

[0041] Sine and cosine functions are used to encode the periodicity of time. The periodic encoding function P(t) is as follows:

[0042] P(t)=[sin(ωt),cos(ωt)] (3)

[0043] Here, ω represents the periodic angular frequency vector, which is used to capture the periodicity of different granularities in time t.

[0044] Preferably, in step S21, the time span code is specifically:

[0045] The embedding combination and embedding difference methods are used to capture the span and length information of the time period. The embedding combination method combines the start time embedding and the end time embedding to obtain the embedding of the absolute position of the start time and the end time of the time period.

[0046] The embedding difference method captures the length and span of the time period by calculating the mean and difference of the embeddings of the start and end times;

[0047] The two methods of embedding combination and embedding difference are combined to capture the rich features of the time period through the start time and end time of the time period:

[0048] E avg =(E start +E end ) / twenty four)

[0049] E diff =E end -E start (5)

[0050] Among them, E start The embedding vector representing the start time of the time period, E end The embedding vector representing the end time of the time period, E avg represents the mean of the time segment embedding vector, E diff Represents the difference between the end time embedding and the start time embedding of a time period;

[0051] E start 、E end 、E diff 、E avg and the periodic code P(t) together to form a comprehensive feature vector E period , and then send the feature vector to the feedforward neural network for training to obtain the final time segment code E time :

[0052] E period =[E start ; E end ; E diff ; E avg ; P(t start ); P(t end )] (6)

[0053] E time =NN(E period ) (7)

[0054] Among them, NN represents a feedforward neural network, [;] represents the concatenation operation of vectors, and P(t start ) and P(t end ) represent the periodic encoding of the start time and end time respectively.

[0055] Preferably, in step S3, the evaluation indicators include the area under the ROC curve AUC and the average percentile ranking APR;

[0056] The AUC measures the model's ability to distinguish between correct answers and random negative samples by calculating the ROC curve and finding the area under the curve;

[0057] The APR measures the relative ranking of the correct answers given by the model across all queries by calculating the average percentile rank of the correct answers in the model's predictions.

[0058] Therefore, the present invention adopts the above-mentioned method for constructing an implicit reasoning model of a geographic knowledge graph taking into account the characteristics of time periods, and the beneficial effects are as follows:

[0059] (1) The present invention unifies the encoding of time points and time periods by means of dimensionality increase, constructs a geographic logic query and answering system based on time period feature extraction, and solves the problem that the current time encoder is insufficient in encoding and extracting time period features.

[0060] (2) The present invention improves the ability to process time segment information and multi-scale time information through different time scale control functions, solves the limitations of existing time encoders in processing time segment information and multi-scale time information, and verifies the ability and effectiveness of time segment encoders in extracting time features in downstream tasks.

[0061] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is an overall flow chart of an embodiment of a method for constructing an implicit reasoning model of a geographic knowledge graph taking into account time period characteristics of the present invention;

[0063] Figure 2 It is a model structure diagram of an embodiment of a method for constructing a geographic knowledge graph implicit reasoning model taking into account time period characteristics of the present invention;

[0064] Figure 3 The time data distribution of the embodiment of the method for constructing the geographic knowledge graph implicit reasoning model taking into account the time period characteristics of the present invention;

[0065] Figure 4 It is an example of a geological sample data set of an embodiment of a method for constructing an implicit reasoning model of a geographic knowledge graph taking into account time period characteristics of the present invention;

[0066] Figure 5 The entity types and quantities in the geological sample knowledge graph of the embodiment of the method for constructing an implicit reasoning model of a geographic knowledge graph taking into account time period characteristics of the present invention;

[0067] Figure 6It is a schematic diagram of the model structure of the intersection operator based on the self-attention mechanism in an embodiment of the method for constructing an implicit reasoning model of a geographic knowledge graph taking into account time period characteristics of the present invention;

[0068] Figure 7 It is a time segment encoder model structure of an embodiment of a method for constructing a geographic knowledge graph implicit reasoning model taking into account time segment characteristics of the present invention;

[0069] Figure 8 It is a time period encoder model structure based on a global scale adjustment module in an embodiment of the method for constructing an implicit reasoning model of a geographic knowledge graph taking time period characteristics into consideration in the present invention. DETAILED DESCRIPTION

[0070] The technical solution of the present invention is further described below through the accompanying drawings and embodiments.

[0071] Unless otherwise defined, technical or scientific terms used in the present invention shall have the common meanings understood by one having ordinary skills in the field to which the present invention belongs.

[0072] like Figure 1 As shown in FIG. 1 , a method for constructing an implicit reasoning model of a geographic knowledge graph taking into account time period characteristics includes the following steps:

[0073] S1. Construct a geological sample data set containing multi-scale time period information for subsequent experimental verification. This data set mainly focuses on two aspects: time period information and cross-scale time information. Time period information means that most of the time information contained in the entities in the data set is time period information, and cross-scale time information means that the time information contained in the entities in the data set not only includes modern time such as 1900, but also includes large-scale geological time such as 200Ma. It specifically includes the following steps:

[0074] S11. Data source:

[0075] The geological sample age knowledge graph is constructed on the basis of the geological sample dataset, which is provided by the "Using geological age graph to accurately interpret geological time in literature" competition held by Deep-time Digital Earth (DDE), and collects a wide range of geological sample information. The geological sample dataset contains geological sample data from different literatures, and each record reflects the lithology code, lithology number and specific geographical location of the sample, including the continent, country and longitude and latitude of the sample, as well as notes related to its geographical location.

[0076] At the same time, the dataset also records the literature from which the sample data came and the time when the literature was published. For each sample, a geological time interpretation algorithm is used to obtain the geological age map referenced by the geological sample and the specific start time, end time and corresponding uncertainty. These data provide reliable reference version information for the construction of the knowledge graph, identifying the source of the data and the version of the reference. The example data of the geological sample dataset is as follows: Figure 4 shown.

[0077] S12. Data preprocessing:

[0078] Each sample in the geological sample data set records the corresponding time information: the geological age of the sample represented by the Start and End columns and the time mentioned in the relevant literature in the PrimaryReference column. The specific process of data preprocessing includes:

[0079] 1) In order to uniformly encode the time, the data in the Start and End columns need to be converted into a common year format and expression. The time unit in the Start and End columns is millions of years ago Ma. Multiply the data by -1*10 6 .

[0080] 2) For the time mentioned in the relevant documents in the PrimaryReference column, use regular expressions to extract the year in the column. After extracting all the time, convert it into a universal expression of year, month, day, hour, minute, and second.

[0081] 3) Since the existing identifier OldIDNumber in the sample is not unique in the dataset, in order to ensure the uniqueness of each sample name in the knowledge graph, an increasing integer sequence NewIDNumber is created to assign a unique ID to each record as the sample name to connect the geographic location, time information, lithology description and other related data.

[0082] S13. Knowledge graph construction:

[0083] In order to link sample data with relevant information such as geographic location, time, and literature citations, a geological sample knowledge graph containing time and location information is formed. First, it is necessary to determine the relationship between entities in the knowledge graph, such as (sample 1, isLocatedin, Canada). By specifying the relationship between each column of entities, the triples are converted into nodes and edges in the graph; the attribute assignment of the sample node is completed by normalizing the time label and mapping the geographic coordinates; Figure 5As shown, the present invention divides the relationships in the data set into seven types: Name (sample name), Place (location), Comments (comments), Formation (information), Period (period), Lithology (lithology) and Reference (reference).

[0084] S14. Question and answer dataset construction:

[0085] The geological sample data set is oriented to the time period and large-scale time feature extraction problems, which contains 9105 entities, 40506 triples, and 22 types of relationships. After the time information is expanded, the number of geographic entities with time information is 6026, and the number of non-geographic entities without time information is 3079. There are 4923 geographic entities with time periods, 4923 geographic entities with large-scale time, and 1103 geographic entities with small-scale time, such as 320Ma and 1997. Therefore, the present invention divides the triples in the knowledge graph into training set, test set and validation set according to the ratio of 90:9:1.

[0086] Query and answer pairs for constructing geological sample datasets after sampling QA = {q i ,a i}, when constructing the question-answering dataset, the sampling rule follows the basic query subgraph pattern, sampling a fixed number of n example queries for each query subgraph. For a given basic query subgraph pattern d = [d1, d2, …, d E ], where E means that the subgraph pattern d has E edges. Sampling is performed by sampling the target node, sampling the neighboring nodes, iterating the queue, and setting the termination condition:

[0087] Target node sampling: First, the target nodes of the query are sampled.

[0088] Adjacent node sampling: Sample the next node along the edge from the target node and add this node to the queue.

[0089] Queue iteration: Pop nodes from the queue one by one, select several neighbor nodes for each popped node, and add these neighbor nodes to the queue.

[0090] Termination condition: When the remaining nodes cannot meet the sampling requirements of the current query subgraph pattern, sampling is terminated to ensure that the sampled query subgraph pattern meets the requirements.

[0091] In the construction of the training set, the present invention randomly removes 10% of the edges in the network, and then samples according to the above method to construct a question-answering data set for training. For the test set and the validation set, sampling is performed directly on the original network to ensure that each test query depends on at least one edge that was removed during the training phase. This method ensures that queries in the test set cannot be directly solved by the information in the training set, preventing the model from relying solely on memorizing training data to answer test questions, thereby prompting the model to learn deeper features and laws. This method improves the generalization and robustness of the model, making the model perform better on new data. Through such a design, the model cannot simply solve the problems in the test set by memorizing specific patterns in the training set, thereby effectively improving the model's adaptability to new data and prediction accuracy. The number of geological samples and geographic logical queries is shown in Table 1:

[0092] Table 1 Statistics of geological samples and geographic logical queries

[0093]

[0094]

[0095] S2. Establishing an implicit reasoning model that takes into account the characteristics of the time period, specifically including the following steps:

[0096] In view of the problem that existing time encoders cannot effectively extract time period features, the present invention designs a time period encoder oriented to time period features, proposes an implicit reasoning model that takes time period features into account, and verifies the effectiveness of the proposed time period encoder by integrating it into knowledge graph geographic logic query.

[0097] According to the characteristics of the time segment, such as the start time, end time, span and periodicity, the design of the time segment encoder is considered from the aspects of time scale adjustment, periodicity coding and time segment span coding.

[0098] S21. Design a temporal encoder Enc for time segment features (p) ();

[0099] In order to effectively encode time segments with complex temporal attributes, the time segment features include start time, end time, span and periodicity. (p) (), the time point is regarded as a special time period, that is, the start time of the time period is equal to the end time; for the time information of the two dimensions of time point and time period, the time point can be expressed in the form of time period, that is, the dimension is upgraded.

[0100] This processing method can effectively unify the encoding of time points and time periods, simplify the complexity of processing data of different time dimensions, and provide a unified representation framework for time points and time periods. At the same time, processing time points and time periods under a unified representation framework allows the model to be trained on a wider range of data sets, thereby improving its generalization ability. The model can learn from the common features of time points and time periods, which helps to improve the robustness and performance of the encoding model when facing different types of time data. The model structure is as follows: Figure 7 shown.

[0101] The feature extraction and combination of time periods will be considered from three aspects: time scale adjustment, periodicity coding and time period span coding;

[0102] 1) The specific process of time scale adjustment is as follows:

[0103] In view of the multi-scale, large span, and wide span characteristics of time data, different logarithmic functions are applied to the time values ​​to reduce the scale of the start and end time to balance the huge difference between modern and ancient time values. To this end, the present invention defines two time scaling functions S(t).

[0104] The first is a magnitude scaling method based on logarithmic adjustment S (l) (t), the specific process is as follows:

[0105] First, a logarithmic function is used to determine a benchmark value, and then all data are scaled according to this benchmark value to reduce the impact of the order of magnitude while trying to preserve the relative size relationship of the original data; by combining logarithmic transformation and order of magnitude scaling, the order of magnitude differences that may be caused by cross-scale time data when input into the deep learning model are reduced:

[0106]

[0107] in, Indicates the rounding down operation, t min Indicates the minimum time value in the data set or a manually specified reference value.

[0108] The second is the absolute value logarithmic transformation method S( k) (t), the specific process is as follows:

[0109] By using the absolute value |t|, we ensure that even if t is negative, |t|+c is positive, so that the function value is within the domain of definition. k , the time data is mapped to a new scale:

[0110] S (k) (t) = log k (|t|+c) (4)

[0111] Here, k and c are adjusted parameters to control the degree and offset of scaling to ensure the applicability and smooth transition of the logarithmic function.

[0112] 2) The specific periodic coding is:

[0113] In order to capture the periodic characteristics of time, sine and cosine functions are used to encode the periodicity of time. The periodic encoding function P(t) is as follows:

[0114] P(t)=[sin(ωt),cos(ωt)] (5)

[0115] Here, ω represents the periodic angular frequency vector, which is used to capture the periodicity of different granularities in time t.

[0116] 3) The time span code is as follows:

[0117] In order to embed the time period features into the vector space, the embedding combination and embedding difference methods are used to capture the span and length information of the time period. The embedding combination method combines the start time embedding and the end time embedding to obtain the embedding of the absolute position of the start time and the end time of the time period.

[0118] The embedding difference method captures the length and span of the time period by calculating the mean and difference of the embeddings of the start and end times;

[0119] Therefore, the present invention combines the two methods of embedding combination and embedding difference to capture the rich features of the time period through the start time and end time of the time period:

[0120] E avg =(E start +E end ) / 2 (6)

[0121] E diff =E end -E start (7)

[0122] Among them, E start The embedding vector representing the start time of the time period, E end The embedding vector representing the end time of the time period, E avg represents the mean of the time segment embedding vector, E diff Indicates the difference between the end time embedding and the start time embedding of the time period.

[0123] After obtaining the characteristics of the above time period, E start 、E end 、E diff 、Eavg and the periodic code P(t) together to form a comprehensive feature vector E period , and then send the feature vector to the feedforward neural network for training to obtain the final time segment code E time :

[0124] E period =[E start ; E end ; E diff ; E avg ; P(t start ); P(t end )] (8)

[0125] E time =NN(E period ) (9)

[0126] Among them, NN represents a feedforward neural network, [;] represents the concatenation operation of vectors, and P(t start ) and P(t end ) represent the periodic encoding of the start time and end time respectively.

[0127] S22, construct an implicit reasoning model that takes into account the characteristics of time periods;

[0128] The implicit reasoning model of the geographic knowledge graph that takes into account time period characteristics includes three parts: an entity encoder, a projection operator, and an intersection operator. Among them, the entity encoder consists of an entity feature encoder and a time period feature encoder, which encode the entity features and time period features of the knowledge graph respectively, and then combine them into an entity vector containing time period features. The projection operator is used to calculate the projection of the entity vector on the relationship vector to obtain the result vector, and the intersection operator is used to calculate multiple result vectors to obtain the final target vector. Finally, the target node to be inferred is obtained through the nearest neighbor search. The structure of the implicit reasoning model of the geographic knowledge graph that takes into account time period characteristics is as follows: Figure 2 The entity feature encoder Enc used by the implicit reasoning model considering time period features proposed in the present invention is (c) (), projection operator and intersection operator based on self-attention mechanism I (CGA) ()Specifically:

[0129] Entity Feature Encoder Section:

[0130] The entity feature encoder Enc used (c) () Any entity e in the geographic knowledge graph i Embedded in d (c) dimensional vector space;

[0131] For any entity e i∈V, entity feature encoder Enc (c) () will calculate the entity e through the embedded lookup method i Embedding:

[0132]

[0133] in, is the embedding matrix of all entity types in the geographic knowledge graph, Represents entity e i One-hot vector in geographic knowledge graph, therefore, An embedded lookup operation will be performed to obtain e from the corresponding column i Entity embedding,||·|| L2 represents the L2 norm.

[0134] Projection operator part:

[0135] For a given geographic knowledge graph G, the projection operator P() performs link prediction operations, calculating entities and relationships in space to obtain prediction vectors. Depending on the input object, it can be divided into two types: P (e) (e i ,r) and P (e) (V i ,r).P (e) (e i ,r) The input processed is a triple head entity e i and relation r, predict the tail entity. (e) (V i ,r) processes the basic graph query model b=r(V i ,V j ), v i is V constrained by existential quantifiers i vector embedding to predict V j The vector embedding of .

[0136]

[0137] in, and is a trainable relationship matrix, and The functions of are feature embedding and time embedding respectively.

[0138] The intersection operator part based on the self-attention mechanism:

[0139] Use the intersection operator to process the logical AND operation in geographic logical queries and find common entities between multiple entity sets;

[0140] The intersection operator I() from multiple e1? ,e 2? ,...,e i? ,...,e n? Perform an intersection operation in the embedding to obtain a single target node V in the query embedding q ? Embed ? , which can be expressed as:

[0141] e ? =I({e 1? ,e 2? ,...,e i? ,...,e i?})

[0142] The intersection operator can use the average value, minimum value, and maximum value of the elements in the vector, or a permutation-invariant neural network structure such as DeepSets.

[0143] The GQE model uses the element-wise minimum method together with a feedforward network as the intersection operator. (GQE) (), the CGA model uses the intersection operator I based on the self-attention mechanism (CGA) ().

[0144] In the framework of GQE, each query is represented as its directed acyclic graph (DAG) structure, and then an algorithm is used to generate the embedding of the query based on this DAG. This process starts with the anchor node embedding of the query and generates the embedding corresponding to the query by iteratively applying geometric operations.

[0145] Mai borrowed the idea of ​​graph attention mechanism and proposed an intersection operator based on attention mechanism, and proved that the intersection operator based on self-attention mechanism proposed in CGA model is (CGA) () performs better than I (GQE) (). Therefore, the present invention adopts I (CGA) () As the intersection operator of the TFKGE model, the intersection operator based on the self-attention mechanism I (CGA) The model structure of () is as follows Figure 6 By maintaining the overall consistency of the model, we further explore the ability of the time segment encoder to extract time segment features and the role of time segment features in geographic logical queries on the knowledge graph.

[0146] S23, model training;

[0147] In order to quantitatively evaluate the time segment encoder Enc (p) The performance of TFKGE and its fusion model on geographic question answering tasks. TFKGE is trained on the basis of the newly constructed geological sample dataset. periodThe model and multiple parameter models are then compared with the baseline model based on the Yago15k dataset. In this embodiment, five baseline models are set to test TFKGE period The model's contribution to geographic logical question answering tasks.

[0148] (1)TFKGE period :TFKGE period The role is to serve as a baseline model, without considering the time scale adjustment, only considering the time segment encoder Enc (p) () Its ability to extract time features.

[0149] (2)TFKGE period-l and TFKGE period-k :TFKGE period-l and TFKGE period-k Respectively represent the use of the time scale adjustment module S (l) (t) and S (k) (t), the model is used as a time segment feature encoder Enc (p) ()The optimization effect of time scale when using different time scale modules.

[0150] (3)TFKGE period-lg and TFKGE period-kg : With TFKGE period-l and TFKGE period-k In comparison, TFKGE period-lg and TFKGE period-kg The global time scale adjustment module will be used, that is, before the time span is encoded, the time scale adjustment module is also used for time scaling. The purpose of setting this model is to study the impact of the position of the time scale adjustment module in the model on performance. The network structure diagram is as follows Figure 8 shown.

[0151] S3. Evaluate the model performance by evaluating indicators and analyzing experimental results.

[0152] The evaluation indicators include the area under the ROC curve (AUC) and the average percentile ranking (APR); AUC measures the model's ability to distinguish between correct answers and random negative samples by calculating the ROC curve and finding the area under the curve; APR measures the relative ranking of the correct answers given by the model in all queries by calculating the average percentile ranking of the correct answers in the model's predictions.

[0153] 1) Experimental parameter setting

[0154] The general data of the experimental platform are shown in Table 2, and some newly added and modified experimental parameters are shown in Table 3. In terms of model training parameters, first, the time segment encoder Enc(p) () respectively adopt the order of magnitude scaling method without scale scaling and logarithmic adjustment S (l) (t) and absolute value logarithmic transformation method S (k) (t), through the experimental results to analyze the time segment encoder Enc (p) () The ability to capture the characteristic information of the time period. For the order of magnitude scaling method S (l) (t) medium min Use the minimum value of the time data in the data set. For the absolute value logarithmic transformation method S (k) (t), by observing the data structure of time information, it is found that the values ​​of time information are mainly concentrated around 1900 and around 300Ma. When k is e and c is 1, the mapping effect of time value is relatively good. When the time data is close to the minimum value, it will not cause too large a difference in the relationship between the mapped data.

[0155] Table 2 General experimental parameter settings

[0156] CGA QUR <![CDATA[GQE diag ]]> <![CDATA[TFKGE direct ]]> <![CDATA[TFKGE fnn ]]> <![CDATA[TFKGE full ]]> Entity Embedding Dimension 64 64 64 64 64 64 Time Encoder - - - Direct Encoding FNN Date2Vec Time Embedding Dimension - - - 6 64 64 Time feature weight - - - 1 1 0.02 Learning Rate 0.001 0.001 0.001 0.001 0.001 0.001 Activation Function Leakyrelu Leakyrelu Leakyrelu Leakyrelu Leakyrelu Leakyrelu Temporal Activation Function False False False False False Sin Optimizer Adam Adam Adam Adam Adam Adam Batch size 2048 2048 2048 2048 2048 2048 Maximum training cycle 100000 100000 100000 100000 100000 100000 Tolerance Threshold 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 Decoder Bilinear Bilinear <![CDATA[Bilinear diag ]]> <![CDATA[Bilinear diag ]]> <![CDATA[Bilinear diag ]]> <![CDATA[Bilinear diag ]]> Intersection Decoder Minsimple Min Min Min Min Min

[0157] Table 3 New experimental parameter settings

[0158]

[0159]

[0160] 2) Logical query results based on geological sample datasets

[0161] The present invention tests the performance of geographic logic query on different baseline models and fusion models based on geological sample data sets. The experimental results of the baseline model are shown in Table 4, and the experimental results of the fusion model are shown in Table 5.

[0162] Without integrating temporal features, GQE diag The model achieved high AUC and APR values ​​on most tasks, and its overall performance was better than CGA and GQE, and was consistent with the logical query results based on the Yago15k dataset. GQE outperformed CGA and GQE on tasks using hard negative sampling methods such as Hard-2-inter, Hard-3-chain-inter, and Hard-3-inter, and on overall performance. diag The performance of GQE is significantly better than that of CGA. GQE, which uses a bilinear diagonal matrix as the projection operator, is better than that of GQE in the geological sample data set. diag Achieved better results.

[0163] Table 4 Experimental results of the baseline model on the geological sample dataset

[0164]

[0165] Table 5 shows the TFKGE with time features. direct TFKGE fnn TFKGE full and TFKGE period The experimental results of the model in the geological sample data set. In the 2-inter, Hard-2-inter, 3-chain-inter, Hard-3-inter and other tasks, higher AUC and APR values ​​were obtained, which shows that the fusion of time features significantly improves the reasoning ability and accuracy of the model. At the same time, by comparing CGA, GQE and GQE diag From the performance of the TFKGE model with time features, we can find that the performance of the TFKGE model with time features integrated on this dataset is still better than that of the baseline model without time features integrated on this dataset, which is consistent with the performance on the Yago15k dataset. This fully demonstrates that using time information in the knowledge graph can improve the accuracy of logical query tasks.

[0166] In terms of overall performance, TFKGE period Model compared to TFKGE direct TFKGE fnn and TFKGE full The AUC and APR values ​​of the model reached the highest, which shows that the time segment encoder is better than other time encoders in extracting time features on the geological sample dataset.

[0167] Table 5 Experimental results of the fusion model on the geological sample dataset

[0168]

[0169] 3) Analysis of logical query results based on different data sets

[0170] TFKGE is analyzed based on the geological sample dataset and the Yago15k dataset with extended time information. period TFKGE direct TFKGE fnn and TFKGE fullLogical query results of the model. Table 6 shows the performance indicators of each model on different data sets. By comparing the performance of the models on different data sets horizontally, it can be found that the performance of each time encoder in the geological sample data set is inconsistent with that in Yago15k. On the geological sample data set, the performance of the time period encoder is better than Date2vec, while Date2vec achieves the best performance on the Yago15k data set. In order to solve the coding problem of multi-scale time and the feature coding problem of time periods in the data set, the time information in the data set constructed by the present invention is concentrated on different scales between millions of years and years, and focuses on the acquisition of time period data. Therefore, the reason for this difference may be the inconsistent time distribution in the two data sets. From the experimental results, the Date2vec encoder has a better time feature extraction capability for modern time, while the time period encoder PE has a relatively high time extraction capability for time periods and cross-scale time information.

[0171] On the geological sample dataset, TFKGE fnn The APR index of the model is slightly lower than that of TFKGE, which directly integrates time information. direct The model shows that the ability of feedforward neural networks to process cross-scale time datasets is relatively weak. At the same time, TFKGE with Date2vec temporal encoder full The model achieved the worst results on this dataset, which may be because the Date2vec model with an autoencoder structure has poor ability to restore cross-scale time datasets in the decoding part. direct TFKGE fnn TFKGE full and TFKGE period The performance of the models on different data sets and Table 5 show that the indicators of each model on the geological sample data set are generally higher than those on Yago15k. This is because the geological sample data set is relatively small, there may be a certain degree of overfitting, and the ability of the model to generalize to new data is reduced.

[0172] Table 6 Performance of the model on different datasets

[0173]

[0174] 4) Logical query results based on different time scale scaling methods

[0175] This paper studies the ability of the time segment encoder PE in extracting time features based on different time scale scaling methods, as well as the performance of the time segment encoder PE in geographic logical query tasks when fusing time features. The following table shows the performance of the time segment encoder PE in extracting time features based on different time scale scaling methods. periodThe logical query results of the model on the geological sample dataset. period represents the model without time-scale scaling, used for control experiments. period-l Indicates that the order of magnitude scaling method S is used (l) (t) model, TFKGE period-k Indicates that the absolute value logarithmic transformation method S is used (k) (t) model.

[0176] From Table 7, we can see that TFKGE period-l On the test set, the AUC and APR are 0.9509 and 96.8378 respectively. period-l The AUC and APR on the test set are better than TFKGE period They are 0.0023 and 0.0928 higher, respectively, which indicates that the order of magnitude scaling method S (l) TFKGE after (t) period The model’s ability to extract time segment features is significantly higher than that of the baseline model that does not use the time scale scaling function. This performance improvement shows that the order of magnitude scaling method S is more effective when processing the test set. (l) (t) can provide some advantages. This may be because the temporal features are scaled to reduce the impact of extreme time values ​​while maintaining the relative relationship in time scale.

[0177] For the absolute value logarithmic transformation method S (k) (t)TFKGE period-k The model's performance on the validation set is similar to that of TFKGE period and TFKGE period-l The performance of is close, but overall on the test set is lower than TFKGE period and TFKGE period-l This shows that the absolute value logarithmic transformation method S (k) (t) The improvement of temporal features after time scale scaling extracted by the time encoder is not obvious enough, and even decreases slightly.

[0178] Table 7 Model experimental results based on different time scale scaling methods

[0179]

[0180]

[0181] 5) Logical query results of the time scale adjustment module at different locations in the model

[0182] The present invention conducts experiments based on the time scale adjustment module at different positions in the model, using the TFKGE based on the comparative example.period-l and TFKGE period-k The experimental results of the model are used as a baseline model to compare and study the impact of the global time scale adjustment module on the performance of the time segment encoder. period-lg represents the order of magnitude scaling method S using the logarithmic adjustment of the global position (l) (t)TFKGE period Model, TFKGE period-kg Indicates the absolute value logarithmic transformation method S of the global position (k) (t)TFKGE period Model. Table 8 shows the logical query results of the implicit reasoning model using the global time scale adjustment module.

[0183] From Table 8 and comparison with Table 7, it can be seen that the order of magnitude scaling method S of the logarithmic adjustment of the global position is adopted. (l) (t)After that, TFKGE period-lg The overall performance on the test set is compared with TFKGE period-l In the time scale adjustment module, the logarithmic adjustment order of magnitude scaling method S (l) (t) Local adjustment can better extract the features of time periods to improve the performance of downstream tasks.

[0184] From the absolute value logarithmic transformation method of the global position S (k) (t)TFKGE period According to the experimental results of the model, TFKGE period-lg The overall performance of the model in geographic logical queries is significantly better than TFKGE period-l Model. In the global position absolute value logarithmic transformation method S( k) After (t), the performance of the model has improved overall. This may be because the logarithmic transformation of the time value leads to a large difference before and after the mapping. After adjusting the time scale adjustment module to the global position, the difference between the time span encoding module and other encoding modules in the model is compensated, and the performance of the model is improved.

[0185] Table 8 Logical query results of the global time scale adjustment module

[0186]

[0187]

[0188] In summary, the present invention first analyzes the inadequacy of the existing time encoder in extracting time period features, and proposes to construct a time period encoder for time period feature extraction; a multi-scale geological sample age knowledge graph is constructed, which includes the time information, geological information and literature sources of geological samples. Subsequently, based on the geological sample age knowledge graph, a geographic logical query data set is constructed to analyze the encoding effect of the time period encoder on multi-scale and large-span time.

[0189] Then, the present invention constructs a geographic logic query model based on time period coding. By upgrading the dimension of time points, the coding of time points and time periods is unified; the characteristics of time periods are considered from three aspects: time scale adjustment, periodic coding, and time period span coding, and a time encoder that processes multi-scale and large-span time period information is designed.

[0190] Therefore, the present invention adopts the above-mentioned method of constructing an implicit reasoning model of the geographic knowledge graph taking into account the time period characteristics, analyzes the impact of different time scale scaling methods on the performance of the time period encoder, and compares the performance of different models on the geological sample age knowledge graph, further verifies the ability of the time period encoding method to extract time period characteristics and its effectiveness in improving the performance of geographic logical queries on the knowledge graph.

[0191] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.

Claims

1. A method for constructing an implicit reasoning model of a geographic knowledge graph taking into account time period characteristics, characterized in that: The following steps are involved: S1. Construct a multi-scale geological sample dataset; S2, establish an implicit reasoning model that takes into account the characteristics of the time period; S3. Evaluate the model performance by evaluating indicators and analyzing experimental results.

2. The method for constructing an implicit reasoning model of a geographic knowledge graph taking into account time period characteristics according to claim 1 is characterized in that: Step S1 specifically includes the following steps: S11. Data source: The geological sample dataset contains different geological sample data. Each record reflects the lithology code, lithology number and specific geographical location of the sample, including the continent, country and longitude and latitude of the sample, as well as notes related to its geographical location. For each sample, a geological time interpretation algorithm is used to obtain the geological age map referenced by the geological sample and the specific start time, end time and corresponding uncertainty; S12. Data preprocessing: Each sample in the geological sample data set records the corresponding time information: the geological age of the sample represented by the Start and End columns and the time in the PrimaryReference column. The specific process of data preprocessing includes: Convert the data in the Start and End columns to a common year format and expression. The time unit in the Start and End columns is millions of years ago Ma. Multiply the data by -1×10 6 ; For the time in the PrimaryReference column, use a regular expression to extract the year in the column. After extracting all the time, convert it into a common expression of year, month, day, hour, minute, and second. Assign a unique ID to each record by creating an increasing integer sequence NewIDNumber, which serves as the sample name to connect the geographic location, time information, and lithology description; S13. Knowledge graph construction: Determine the relationship between entities in the knowledge graph, and convert the triples into nodes and edges in the graph by specifying the relationship between entities in each column; complete the attribute assignment of sample nodes by normalizing time labels and mapping geographic coordinates; S14. Question and answer dataset construction: The triplets in the knowledge graph are divided into training set, test set and validation set in a ratio of 90:9:

1. After sampling, the query and answer pairs of the geological sample dataset are constructed. QA .

3. The method for constructing an implicit reasoning model of a geographic knowledge graph taking into account time period characteristics according to claim 2 is characterized in that: Step S2 specifically includes the following steps: S21. Design a temporal encoder Enc for time segment features (p) (); Encode time periods with complex time attributes. Time period features include start time, end time, span, and periodicity. Time points are regarded as special time periods, that is, the start time of a time period is equal to the end time. For time information of both time points and time periods, time points are expressed in the form of time periods, that is, dimensionality is increased. The feature extraction and combination of time periods will be considered from three aspects: time scale adjustment, periodicity coding and time period span coding; S22. Construct an implicit reasoning model of geographic knowledge graph that takes into account the characteristics of time periods; Implicit reasoning model of geographic knowledge graph considering time period characteristics TFKGE period It includes three parts: entity encoder, projection operator and intersection operator. The entity encoder consists of entity feature encoder and time period feature encoder, which encode the entity features and time period features of the knowledge graph respectively, and then combine them into an entity vector containing time period features. The projection operator is used to calculate the projection of the entity vector on the relationship vector to obtain the result vector, and the intersection operator is used to calculate multiple result vectors to obtain the final target vector. Finally, the target node to be inferred is obtained through the nearest neighbor search. S23, model training; Training TFKGE on a newly constructed geological sample dataset period The model and multiple parameter models are then compared with the baseline model on the Yago15k dataset to test TFKGE period The model's contribution to geographic logical question answering tasks.

4. The method for constructing an implicit reasoning model of a geographic knowledge graph taking into account time period characteristics according to claim 3 is characterized in that: In step S21, the specific process of adjusting the time scale is as follows: By applying different logarithmic functions to the time values ​​to reduce the scale of the start and end times, two time scaling functions S(t) are defined: The first order of magnitude scaling method based on logarithmic adjustment S (l) (t), the specific process is as follows: First, a logarithmic function is used to determine a benchmark value, and then all data are scaled according to this benchmark value to retain the relative size relationship of the original data; by combining logarithmic transformation and order of magnitude scaling, the order of magnitude differences that may be caused by cross-scale time data when input into the deep learning model are reduced: in, Indicates the rounding down operation, t min Indicates the minimum time value in the data set or a manually specified reference value; The second absolute value logarithmic transformation method S (k) (t), the specific process is as follows: By using the absolute value of |t|, we ensure that even if t is negative, |t|+c is positive, so that the function value is within the domain of definition, and the logarithmic transformation log k , the time data is mapped to a new scale: S (k) (t)=log k (|t|+c) (2) Here, k and c are adjusted parameters that control the degree of scaling and offset.

5. The method for constructing an implicit reasoning model of a geographic knowledge graph taking into account time period characteristics according to claim 3 is characterized in that: In step S21, the periodic coding is specifically: Sine and cosine functions are used to encode the periodicity of time. The periodic encoding function P(t) is as follows: P(t)=[sin(ωt),cos(ωt)] (3) Here, ω represents the periodic angular frequency vector, which is used to capture the periodicity of different granularities in time t.

6. The method for constructing an implicit reasoning model of a geographic knowledge graph taking into account time period characteristics according to claim 3 is characterized in that: In step S21, the time span code is specifically: The embedding combination and embedding difference methods are used to capture the span and length information of the time period. The embedding combination method combines the start time embedding and the end time embedding to obtain the embedding of the absolute position of the start time and the end time of the time period. The embedding difference method captures the length and span of the time period by calculating the mean and difference of the embeddings of the start and end times; The two methods of embedding combination and embedding difference are combined to capture the rich features of the time period through the start time and end time of the time period: AND avg =(And start +E end ) / 2 (4) AND diff =And end -AND start (5) Among them, E start The embedding vector representing the start time of the time period, E end The embedding vector representing the end time of the time period, E avg represents the mean of the time segment embedding vector, E diff Represents the difference between the end time embedding and the start time embedding of a time period; E start 、E end 、E diff 、E avg and the periodic code P(t) together to form a comprehensive feature vector E period , and then send the feature vector to the feedforward neural network for training to obtain the final time segment code E time : AND period =[And start ;AND end ;AND diff ;AND avg ;P(t start );P(t end )] (6) E time =NN(E period ) (7) Among them, NN represents a feedforward neural network, [;] represents the concatenation operation of vectors, and P(t start ) and P(t end ) represent the periodic encoding of the start time and end time respectively.

7. The method for constructing an implicit reasoning model of a geographic knowledge graph taking into account time period characteristics according to claim 1 is characterized in that: In step S3, the evaluation indicators include the area under the ROC curve AUC and the average percentile ranking APR; The AUC measures the model's ability to distinguish between correct answers and random negative samples by calculating the ROC curve and finding the area under the curve; The APR measures the relative ranking of the correct answers given by the model across all queries by calculating the average percentile rank of the correct answers in the model's predictions.

Citation Information

Patent Citations

  • Knowledge representation reasoning method based on encoder and decoder architecture

    CN113836312A

  • Knowledge graph completion method fusing weight and tense information

    CN116304089A

  • Geology data set question and answer method and system based on knowledge graph reasoning

    CN116955558A

  • Electric power primary equipment fault knowledge graph analysis and completion method based on cognitive reasoning

    CN117370573A

  • Method and apparatus for automatically generating inference questions and answers

    WO2021184311A1