Construction Method of Implicit Inference Model for Geographic Knowledge Graph Considering Temporal Segment Features

By constructing an implicit inference model of geographic knowledge graphs that take into account time period features, the problem of time encoder insufficient encoding and extraction capabilities for time period features is solved, the performance of geographic logic query is improved, and effective extraction of time period features and multi-scale information processing is realized.

CN118982071BActive Publication Date: 2025-07-11HEFEI UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, time encoders lack the ability to encode and extract time period features, ignore multi-dimensional information within the time period, resulting in limited performance of geologic query tasks.

Method used

Build an implicit inference model of geographic knowledge graphs that take into account time period characteristics. Through a geological sample data set with multi-scale time period information, a time period encoder is designed, and time scale adjustment, periodic coding and time period span coding methods are adopted, and a solid encoder, projection operator and intersection operator are combined to improve the time period feature extraction capability.

Benefits of technology

It improves the extraction ability of time period features, enhances the performance of geographic logic query and answers, solves the problem of insufficient encoding and extraction ability of time period features by time encoder, and improves the model's ability to process time information on multi-scale time information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118982071B_ABST
    Figure CN118982071B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of geographical knowledge graph embedding, and specifically discloses a method for constructing an implicit reasoning model of a geographical knowledge graph considering time period features, including the following steps: First, construct a multi-scale geological sample data set; then establish an implicit reasoning model considering time period features; finally, evaluate the model performance through evaluation indicators and analyze experimental results. By adopting the above method for constructing an implicit reasoning model of a geographical knowledge graph considering time period features, aiming at the problem of insufficient ability of existing time encoders to extract time period features, a geographical logical query and answer oriented to time period encoding is constructed. The limitations of existing time encoders in processing time period information and multi-scale time information are solved, a time period encoder oriented to time period features is constructed, and the effectiveness of the time period encoder and its performance in downstream tasks are verified using 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 technical field of geographical knowledge graph embedding, and in particular to a method for constructing an implicit reasoning model of a geographical knowledge graph considering time period characteristics. Background Art

[0002] A geographical knowledge graph introduces the concept of a knowledge graph into the organization and analysis of geographical information, and expresses geographical entities, their related attributes, and the spatial relationships between them in a structured manner such as time and location, greatly enriching the expression and application of geographical information. Many geographical entities and events have significant spatio-temporal characteristics. For example, the changes in administrative regions during urban development, the spatio-temporal evolution during the occurrence of landslide events, etc., all require accurate descriptions of time and space. The geographical logical query task based on a knowledge graph is to use a large amount of structured information stored in the knowledge graph and geographical-related information such as location and time to solve geographical query and reasoning problems. Time has different expression forms, and the encoding of time information has a certain degree of complexity. Different time encoding methods may directly affect the performance of downstream tasks. Currently, there are relatively few studies on encoding time information and applying it in geographical knowledge graph query tasks. Therefore, how to effectively construct a time encoder to extract time features and apply them to downstream tasks such as geographical logical query of knowledge graphs remains a major challenge.

[0003] In the research on the encoding and feature extraction of time information, the dimensionality reduction method that simplifies a time period to a single time point ignores the rich information contained in the time period, including the duration of time, multi-scale time information, and possible internal changes or state transitions, etc. The main difference between a time point and a time period lies in the different information dimensions and magnitudes they contain. A time point can be considered as an instantaneous moment, while a time period represents a continuous interval, including the start time, end time, and all moments in between. In addition, a time period may also contain time features such as duration. Encoding a time period requires not only considering the encoding of time points but also considering the length and span of the time period. Therefore, there is an urgent need for a new time period encoding method to solve the problem of insufficient encoding and extraction capabilities of the current time encoder for time period features. Summary of the Invention

[0004] The object of the present invention is to provide a method for constructing an implicit reasoning model of a geographical knowledge graph considering time period characteristics, which fully utilizes the information within the time period by retaining the multi-dimensional characteristics of the time period, improves the ability to extract time period features, and enhances the performance of geographical logical query and answer.

[0005] To achieve the above object, the present invention provides a method for constructing an implicit reasoning model of a geographical knowledge graph considering time period characteristics, including the following steps:

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

[0007] S2. Establish an implicit reasoning model considering time period characteristics;

[0008] S3. Evaluate the model performance through evaluation indicators and analyze the 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 of the sample, and its specific geographical location, including the continent, country, longitude and latitude where the sample is located, as well as the note information related to its geographical location;

[0012] For each sample, use the geological time interpretation algorithm to obtain the geological age map referred to by the geological sample, as well as the specific start time, end time, and corresponding uncertainty;

[0013] S12. Data preprocessing:

[0014] Each sample in the geological sample dataset records the corresponding time information: the geological age time 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 into a common year format and expression form. The time unit in the Start and End columns is million years ago (Ma), and multiply this data by ;

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

[0017] By creating an increasing integer sequence NewIDNumber, assign a unique ID to each record, which is used as the sample name to connect geographical location, time information, and lithology description;

[0018] S13. Knowledge graph construction:

[0019] Determine the entities in the knowledge graph and the relationships between entities. By specifying the relationships between each column of entities, form triples and convert them into nodes and edges in the graph; through the normalization of time tags and the mapping of geographical coordinates, complete the attribute assignment of sample nodes;

[0020] S14. Construction of Q&A Dataset:

[0021] Divide the triples in the knowledge graph into a training set, a test set, and a validation set according to the ratio of 90:9:1, and construct query and answer pairs for the geological sample dataset after sampling. .

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

[0023] S21. Design a time encoder for time period features ;

[0024] Encode time periods with complex time attributes. The time period features include start time, end time, span, and periodicity. Consider a time point as a special time period, that is, the start time of the time period is equal to the end time; for the time information in these two dimensions of time points and time periods, express the time points in the form of time periods, that is, perform dimension elevation;

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

[0026] S22. Construct an implicit reasoning model for geographical knowledge graph considering time period features;

[0027] The implicit reasoning model for geographical knowledge graph considering time period features, TFKGE period includes three parts: entity encoder, projection operator, and intersection operator; among them, the entity encoder consists of an entity feature encoder and a time period feature encoder, which respectively encode the entity features and time period features of the knowledge graph, and then combine them into an entity vector containing time period features; calculate the projection of the entity vector on the relationship vector through the projection operator to obtain a result vector, and calculate multiple result vectors through the intersection operator to obtain the final target vector; finally, obtain the target node to be inferred through nearest neighbor search;

[0028] S23. Model training;

[0029] Train TFKGE period model and multiple parameter models on the newly constructed geological sample dataset, and then compare with the baseline model on the Yago15k dataset to test the contribution of the TFKGE period model in the geographical logical Q&A task.

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

[0031] Narrow the scale of the start and end times by applying different logarithmic functions to the time values, and define two time scaling functions :

[0032] The first order-of-magnitude scaling method based on logarithmic adjustment , the specific process is as follows:

[0033] First, use the logarithmic function to determine a reference value, and then scale all data according to this reference value, retaining the relative magnitude relationship of the original data; by combining logarithmic transformation and order-of-magnitude scaling, reduce the order-of-magnitude differences that may be caused by cross-scale time data when input into the deep learning model:

[0034] (1)

[0035] Among them, represents the floor operation, represents the smallest time value in the dataset or a manually specified reference value;

[0036] The second absolute value logarithmic transformation method , the specific process is as follows:

[0037] By using the absolute value ∣t∣, ensure that even if t is negative, ∣t∣+c is positive, so that the function value is within the domain, and through logarithmic conversion , the time data is mapped to a new scale:

[0038] (2)

[0039] Among them, and are adjusted parameters used to control the degree and offset of scaling.

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

[0041] Use sine and cosine functions to encode the periodicity of time, and the periodic encoding function , as follows:

[0042] (3)

[0043] Among them, represents the angular frequency vector of periodicity, used to capture the periodicity of different granularities in time.

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

[0045] Use the embedding combination and embedding difference methods 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 positions of the start time and end time of the time period;

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

[0047] Combining the two methods of embedding combination and embedding difference, rich features in the time period are captured through the start time and end time of the time period:

[0048] (4)

[0049] (5)

[0050] Among them, denotes the embedding vector of the start time of the time period, denotes the embedding vector of the end time of the time period, denotes the mean of the time period embedding vectors, denotes the difference between the end time embedding and the start time embedding of the time period;

[0051] Combine , , , and the periodic encoding together to form a comprehensive feature vector , and then send this feature vector into a feed-forward neural network for training to obtain the final time period encoding :

[0052] (6)

[0053] (7)

[0054] Among them, denotes the feed-forward neural network, denotes the concatenation operation of vectors, and respectively denote the periodic encodings of the start time and end time.

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

[0056] The AUC measures the ability of the model to distinguish correct answers from random negative samples by calculating the ROC curve and obtaining the area under the curve;

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

[0058] Therefore, the present invention adopts the above-mentioned method for constructing a geographical knowledge graph implicit reasoning model considering time period features, and the beneficial effects are as follows:

[0059] (1) The present invention unifies the encoding of time points and time periods through a dimensionality increase method, and constructs a geographical logical query and answer system based on time period feature extraction, solving the problem of insufficient encoding and extraction capabilities of the current time encoder for time period features.

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

[0061] The technical solution of the present invention will be further described in detail below through the accompanying drawings and embodiments. Description of the Drawings

[0062] Figure 1 is the overall flowchart of the embodiment of the method for constructing a geographical knowledge graph implicit reasoning model considering time period features of the present invention;

[0063] Figure 2 is the model structure diagram of the embodiment of the method for constructing a geographical knowledge graph implicit reasoning model considering time period features of the present invention;

[0064] Figure 3 is the time data distribution of the embodiment of the method for constructing a geographical knowledge graph implicit reasoning model considering time period features of the present invention;

[0065] Figure 4 is an example of the geological sample data set of the embodiment of the method for constructing a geographical knowledge graph implicit reasoning model considering time period features of the present invention;

[0066] Figure 5 is the entity type and quantity in the geological sample knowledge graph of the embodiment of the method for constructing a geographical knowledge graph implicit reasoning model considering time period features of the present invention;

[0067] Figure 6 is the schematic diagram of the model structure of the intersection operator based on the self-attention mechanism of the embodiment of the method for constructing a geographical knowledge graph implicit reasoning model considering time period features of the present invention;

[0068] Figure 7 is the model structure of the time period encoder of the embodiment of the method for constructing a geographical knowledge graph implicit reasoning model considering time period features of the present invention;

[0069] Figure 8It 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 into account time period characteristics of 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 dataset records the corresponding time information: the geological age time 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) To uniformly encode the time, it is necessary to convert the data in the Start and End columns into a common year format and expression. The time unit in the Start and End columns is million years ago (Ma), and this data is multiplied by .

[0080] 2) For the time mentioned in the relevant literature in the PrimaryReference column, regular expressions are used to extract the years in this column. After extracting all the times, they are converted into a common expression form of year, month, day, hour, minute, and second.

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

[0082] S13. Knowledge graph construction:

[0083] To link the sample data with relevant information such as geographical location, time, and literature citation to form a geological sample knowledge graph containing time and location information. First, it is necessary to determine the entities in the knowledge graph and the relationships between the entities. For example, (Sample 1, isLocatedin, Canada). By specifying the relationships between each column of entities, triples are formed and converted into nodes and edges in the graph; through the normalization of time tags and the mapping of geographical coordinates, the attribute assignment of sample nodes is completed. As Figure 5 shown, the relationships in the dataset of the present invention are divided into seven types: Name (sample name), Place (location), Comments (annotation), Formation (information), Period (era), Lithology (lithology), and Reference (reference literature).

[0084] S14. Q&A dataset construction:

[0085] Regarding the problem of extracting time features of geological sample datasets for time periods and large scales, it contains 9,105 entities, 40,506 triples, and 22 relationship types. After expanding the time information, the number of geographical entities with time information is 6,026, and the number of non-geographical entities without time information is 3,079. There are 4,923 geographical entities containing time periods, 4,923 geographical entities of large-scale time, and 1,103 geographical entities of small-scale time, such as 320 Ma and 1997. Therefore, the present invention divides the triples in the knowledge graph into a training set, a test set, and a validation set according to the ratio of 90:9:1.

[0086] Construct query and answer pairs of geological sample datasets after sampling , when constructing the question and answer dataset, the sampling rule follows the basic query subgraph pattern, and a fixed number n of example queries are sampled for each query subgraph. For a given basic query subgraph pattern , where E represents the subgraph pattern has E edges. Sampling is carried out by steps such as target node sampling, adjacent node sampling, queue iteration, and setting termination conditions:

[0087] Target node sampling: First, sample the target node of the query.

[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 of the current query subgraph pattern, stop sampling 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 the question and answer dataset for training. For the test set and the validation set, sampling is directly performed on the original network to ensure that each test query depends on at least one edge removed during the training phase. This method ensures that the queries in the test set cannot be directly solved by the information in the training set, preventing the model from relying solely on memorizing the training data to answer test questions, thereby prompting the model to learn deeper features and rules. This method improves the generalization ability 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 adaptability and prediction accuracy of the model to new data. The number of geological samples and geographical logic queries is shown in Table 1:

[0092] Table 1 Statistical Count of Geological Samples and Geographical Logic Queries

[0093]

[0094] S2. Establish an implicit inference model considering the characteristics of time periods, specifically including the following steps:

[0095] Aiming at the problem that the existing time encoders cannot effectively extract the characteristics of time periods, the present invention designs a time period encoder for time period characteristics, proposes an implicit inference model considering time period characteristics, and verifies the effectiveness of the proposed time period encoder in integrating geographical logic queries of knowledge graphs.

[0096] Regarding the characteristics of the start time, end time, span, and periodicity of time periods, consider the design of the time period encoder from the aspects of time scale adjustment, periodic encoding, and time period span encoding.

[0097] S21. Design a time encoder for time period characteristics ;

[0098] To effectively encode time periods with complex time attributes, where the time period characteristics include start time, end time, span, and periodicity, design a time encoder for time period characteristics , regarding time points as special time periods, that is, the start time of the time period is equal to the end time; for the time information in these two dimensions of time points and time periods, the time points can be expressed in the form of time periods, that is, dimensionality is increased.

[0099] This processing method can effectively unify the encoding of time points and time periods, simplify the complexity of processing data in 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 enables the model to be trained on a wider range of datasets, thereby improving its generalization ability. The model can learn from the common characteristics 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 Figure 7 shown.

[0100] The feature extraction and combination of time periods will be considered from three aspects: time scale adjustment, periodic encoding, and time period span encoding;

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

[0102] Regarding the characteristics of time data such as multi-scale, large span, and wide span, by applying different logarithmic functions to time values to reduce the scale of the start and end times, so as to balance the huge difference between modern and ancient time values. For this purpose, the present invention defines two time scaling functions 。

[0103] The first is the order-of-magnitude scaling method based on logarithmic adjustment ,and the specific process is as follows:

[0104] First, a logarithmic function is used to determine a reference value, and then all data are scaled according to this reference value to reduce the influence of the order of magnitude while trying to retain the relative magnitude 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 inputting into a deep learning model are alleviated:

[0105] (1)

[0106] Among them, represents the floor operation, represents the smallest time value in the dataset or a manually specified reference value.

[0107] The second is the absolute value logarithmic transformation method ,and the specific process is as follows:

[0108] By using the absolute value ∣t∣, it is ensured that even if t is negative, ∣t∣ + c is also positive, making the function value within the domain. Through logarithmic transformation ,the time data is mapped to a new scale:

[0109] (2)

[0110] Among them, and are adjusted parameters used to control the degree and offset of scaling to ensure the applicability and smooth transition of the logarithmic function.

[0111] 2) The periodic encoding is specifically as follows:

[0112] To capture the periodic characteristics of time, sine and cosine functions are used to encode the periodicity of time, and the periodic encoding function ,is as follows:

[0113] (3)

[0114] Among them, represents the angular frequency vector of periodicity, which is used to capture the periodicity of different granularities in time.

[0115] 3) The time period span encoding is specifically as follows:

[0116] To embed the time period features into the vector space, an embedding combination and an embedding difference method are adopted 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, and can obtain the embeddings of the absolute positions of the start time and the end time of the time period;

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

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

[0119] (4)

[0120] (5)

[0121] Among them, represents the embedding vector of the start time of the time period, represents the embedding vector of the end time of the time period, represents the mean of the time period embedding vectors, represents the difference between the end time embedding and the start time embedding of the time period.

[0122] After obtaining the features of the above time period, 、 、 、 and the periodic encoding are combined together to form a comprehensive feature vector , and then this feature vector is fed into a feed-forward neural network for training to obtain the final time period encoding :

[0123] (6)

[0124] (7)

[0125] Among them, represents the feed-forward neural network, represents the concatenation operation of vectors, and respectively represent the periodic encodings of the start time and the end time.

[0126] S22. Construct an implicit inference model considering time period features;

[0127] The implicit reasoning model of the geographical knowledge graph considering time period features 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 respectively encode the entity features and time period features of the knowledge graph, and then combine them into an entity vector containing time period features. The projection operator calculates the projection of the entity vector on the relationship vector to obtain a result vector, and the intersection operator calculates multiple result vectors to obtain the final target vector. Finally, the target node to be inferred is obtained through nearest neighbor search. The structure of the implicit reasoning model of the geographical knowledge graph considering time period features is as Figure 2 shown. The entity feature encoder adopted by the implicit reasoning model considering time period features proposed by the present invention , the projection operator, and the intersection operator based on the self-attention mechanism are specifically as follows:

[0128] Entity feature encoder part:

[0129] The adopted entity feature encoder embeds any entity in a geographical knowledge graph into a -dimensional vector space;

[0130] For any entity , the entity feature encoder calculates the embedding of the entity through the embedding lookup method:

[0131] (8)

[0132] Among them, is the embedding matrix of all entity types in the geographical knowledge graph, represents the one-hot vector of the entity in the geographical knowledge graph. Therefore, will perform an embedding lookup operation to obtain the entity embedding from the corresponding column, represents L the 2-norm.

[0133] Projection operator part:

[0134] For a given geographical knowledge graph , the projection operator performs a link prediction operation, calculates the entity and the relationship in space to obtain a prediction vector. According to different input objects, it can be divided into two types: and . The input processed by And relationship , predict the tail entity. It deals with logical queries in the basic graph query model , is constrained by the existential quantifier of the vector embedding to predict the vector embedding of.

[0135] (9)

[0136] Among them, and are trainable relational matrices, and functions are feature embedding and temporal embedding respectively.

[0137] Intersection operator part based on self-attention mechanism:

[0138] Process the logical AND operation in the geographical logical query through the intersection operator, and find the common entities among multiple entity sets;

[0139] Intersection operator Performs an intersection operation on multiple embeddings to obtain the query embedding of the single target node in , which can be expressed as:

[0140] ;

[0141] In the intersection operator, the average value, minimum value, and maximum value of the elements in the vector can be used, or permutation-invariant neural network structures such as DeepSets can also be used.

[0142] The GQE model uses the element minimum method and a feed-forward network together as the intersection operator , and the CGA model uses an intersection operator based on the self-attention mechanism .

[0143] In the GQE framework, each query is represented by its directed acyclic graph (DAG) structure, and then the query embedding is generated according to this DAG using an algorithm. This process starts from the embedding of the anchor node of the query and generates the embedding corresponding to the query through iterative application of geometric operations.

[0144] Mai borrowed the idea of the graph attention mechanism, proposed an intersection operator based on the attention mechanism, and proved that the intersection operator based on the self-attention mechanism proposed in the CGA model has better performance than . Therefore, the present invention adopts As the intersection operator of the TFKGE model, the intersection operator based on the self-attention mechanism The model structure is as Figure 6 shown. By maintaining the overall consistency of the model, the ability of the time period encoder to extract time period features and the role of time period features in the geographical logic query of the knowledge graph are deeply explored.

[0145] S23. Model training;

[0146] To quantitatively evaluate the performance of the time period encoder and its fusion model TFKGE in the geographical question answering task, TFKGE is trained on the newly constructed geological sample dataset period model and multiple parameter models, and then compared with the baseline model on the basis of the Yago15k dataset. In this embodiment, five baseline models are set to test the contribution of the TFKGE period model in the geographical logic question answering task.

[0147] (1) TFKGE period : The role of TFKGE period is to serve as a baseline model, without considering the time scale adjustment, only considering the ability of the time period encoder itself to extract time features.

[0148] (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 and , and this model is the optimization effect of the time scale when using different time scale modules as the time period feature encoder .

[0149] (3) TFKGE period-lg and TFKGE period-kg : Compared with TFKGE period-l and TFKGE period-k , TFKGE period-lg and TFKGE period-kg will adopt a global time scale adjustment module, that is, before encoding the time span, the time scale adjustment module is also used to scale the time. The role of setting this model is to study the impact of the position of the time scale adjustment module in the model on the performance. Its network structure diagram is as Figure 8 shown.

[0150] S3. Evaluate the model performance through evaluation indicators and analyze the experimental results.

[0151] The evaluation metrics include the area under the ROC curve (AUC) and the average percentile rank (APR); AUC measures the ability of the model to distinguish correct answers from random negative samples by calculating the ROC curve and obtaining the area under the curve; APR measures the relative ranking of correct answers in the model predictions for all queries by calculating the average percentile rank of correct answers in the model predictions.

[0152] 1) Experimental parameter settings

[0153] The general data of the experimental platform is shown in Table 2 below, and the newly added and modified experimental parameters are shown in Table 3. In terms of model training parameters, first, the time period encoder respectively adopted the order of magnitude scaling method without scale scaling and logarithmic adjustment and the absolute value logarithmic transformation method , and the ability of the time period encoder to capture time period feature information was analyzed through the experimental results. For the order of magnitude scaling method , the minimum value of the time data in the dataset was used. For the absolute value logarithmic transformation method , by observing the data structure of the time information, it was found that the numerical values of the time information were mainly concentrated around 1900 and 300 Ma. When taking e, and taking 1, the mapping effect of the time values was relatively good, and when the time data was close to the minimum value, it would not cause too large a difference in the relationship between the mapped data. k taking e, c taking 1, the mapping effect of the time values was relatively good, and when the time data was close to the minimum value, it would not cause too large a difference in the relationship between the mapped data.

[0154] Table 2 General experimental parameter settings

[0155]

[0156] Table 3 Newly added experimental parameter settings

[0157]

[0158] 2) Logical query results based on the geological sample dataset

[0159] The present invention tested the performance of geographical logical queries on different baseline models and fusion models based on the geological sample dataset. The experimental results of the baseline models are shown in Table 4, and the experimental results of the fusion models are shown in Table 5.

[0160] In the case of not fusing time features, GQE diagThe model achieved high AUC and APR values on most tasks, and its overall performance was better than that of CGA and GQE, and was consistent with the logical query results based on the Yago15k dataset. In tasks such as Hard-2-inter, Hard-3-chain-inter, and Hard-3-inter that adopt the hard negative sample sampling method and the overall performance, GQE diag significantly outperformed GQE and CGA in performance. GQE diag using a bilinear diagonal matrix as the projection operator under the geological sample dataset

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

[0162]

[0163] Table 5 shows the experimental results of the TFKGE direct that incorporates time features fnn 、TFKGE full and TFKGE period models in the geological sample dataset. On tasks such as 2-inter, Hard-2-inter, 3-chain-inter, and Hard-3-inter, higher AUC and APR values were obtained, indicating that the fusion of time features significantly improved the inference ability and accuracy of the model. At the same time, by comparing the performance of CGA, GQE, and GQE diag , it can be found that the TFKGE model that incorporates time features still outperformed the baseline model without time feature fusion on this dataset, which is consistent with the performance on the Yago15k dataset, fully demonstrating that using time information in the knowledge graph can improve the accuracy of logical query tasks.

[0164] In terms of overall performance, the TFKGE period model achieved the highest AUC and APR values compared to the TFKGE direct 、TFKGE fnn and TFKGE full models, indicating that the time segment encoder has a better ability to extract time features on the geological sample dataset than other time encoders.

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

[0166]

[0167] 3) Analysis of logical query results based on different datasets

[0168] Analyze TFKGE based on the geological sample dataset and the Yago15k dataset with extended time information period and TFKGE direct and TFKGE fnn and TFKGE full model's logical query results. Table 6 shows the performance metrics of each model on different datasets. By comparing the performance of the models on different datasets horizontally, it can be found that the performance of each time encoder on the geological sample dataset is not consistent with that on the Yago15k dataset. On the geological sample dataset, the performance of the time period encoder is better than that of Date2vec, while Date2vec achieves the best performance on the Yago15k dataset. To solve the problems of encoding multi-scale time and feature encoding of time periods in the dataset, the time information in the dataset constructed by the present invention is concentrated at different scales between millions of years and years, and attention is paid to obtaining time period data. Therefore, the reason for this difference may be the inconsistent time distributions in the two datasets. From the experimental results, the Date2vec encoder has good time feature extraction ability for modern time, while the time period encoder PE has relatively high time extraction ability for time periods and cross-scale time information.

[0169] On the geological sample dataset, the APR metric of the TFKGE fnn model is slightly lower than that of the TFKGE direct model that directly fuses time information, indicating that the feedforward neural network has relatively weak ability to process cross-scale time datasets. At the same time, the TFKGE full model that fuses the Date2vec time encoder achieves the relatively worst result 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. By comparing the performance of TFKGE direct and TFKGE fnn and TFKGE full and TFKGE period models on different datasets and Table 5, it can be found that the metrics of each model on the geological sample dataset are generally higher than those on the Yago15k dataset. This is because the geological sample dataset is relatively small, and there may be a certain overfitting phenomenon, resulting in a decline in the model's ability to generalize to new data.

[0170] Table 6 Performance of models on different datasets

[0171]

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

[0173] This invention studies the ability of the period encoder PE in extracting time features based on different time-scale scaling methods, as well as its performance in the geographical logic query task when fusing time features. The following table shows the logical query results of the model using different time-scale scaling functions TFKGE period on the geological sample dataset. Among them, TFKGE period represents the model without using the time-scale scaling method, which is used for the control experiment. TFKGE period-l represents the model using the order-of-magnitude scaling method , and TFKGE period-k represents the model using the absolute value logarithmic transformation method .

[0174] As can be seen from Table 7, the AUC and APR of TFKGE period-l on the test set are 0.9509 and 96.8378 respectively. The AUC and APR of TFKGE period-l on the test set are 0.0023 and 0.0928 higher than those of TFKGE period respectively. This indicates that the TFKGE model after using the order-of-magnitude scaling method period has significantly higher ability to extract period features than the baseline model without using the time-scale scaling function. This performance improvement shows that the order-of-magnitude scaling method can provide some advantages when processing the test set. This may be because the time features reduce the influence of extreme time values after scaling, while maintaining the relative relationship on the time scale.

[0175] For the TFKGE model using the absolute value logarithmic transformation method period-k , the indicators on the validation set are relatively close to those of TFKGE period and TFKGE period-l , but the overall performance on the test set is lower than that of TFKGE period and TFKGE period-l models. This shows that using the absolute value logarithmic transformation method has insufficiently obvious improvement in the time encoder for extracting time features after time-scale scaling, and even shows a slight decline.

[0176] Table 7 Experimental results of models based on different time-scale scaling methods

[0177]

[0178] 5) Logical query results of the time-scale adjustment module at different positions in the model

[0179] The present invention conducts experiments at different positions in the model based on the time scale adjustment module, and uses the experimental results of the TFKGE-based comparative example period-l and TFKGE period-k models as the baseline model for comparison to study the impact of the global time scale adjustment module on the performance of the time period encoder. TFKGE period-lg represents the TFKGE model using the order-of-magnitude scaling method with logarithmic adjustment of the global position period model, and TFKGE period-kg represents the TFKGE model using the absolute value logarithmic transformation method of the global position period model. Table 8 shows the logical query results of the implicit inference model using the global time scale adjustment module.

[0180] From Table 8 and the comparison with Table 7, it can be seen that after using the order-of-magnitude scaling method with logarithmic adjustment of the global position the overall performance of TFKGE period-lg on the test set did not increase but rather decreased slightly compared to TFKGE period-l . In the time scale adjustment module, the order-of-magnitude scaling method with logarithmic adjustment using the local adjustment method can better extract the features of the time period to improve the performance of downstream tasks.

[0181] From the experimental results of the TFKGE model using the absolute value logarithmic transformation method of the global position period it can be seen that the overall performance of the TFKGE period-lg model in geographical logical queries is significantly better than that of the TFKGE period-l model. After using the absolute value logarithmic transformation method of the global position the overall performance of the model has been improved. This may be because the logarithmic transformation of the time value results in too large a difference before and after 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, improving the performance of the model.

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

[0183]

[0184] In summary, the present invention first analyzes the deficiencies of existing time encoders 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 geographical logic query dataset is constructed to analyze the encoding effect of the time period encoder on multi-scale and large-span time.

[0185] Then, the present invention is based on the construction process of the geographical logic query model encoded by time periods. By increasing the dimension of time points, the encoding of time points and time periods is unified; considering the characteristics of time periods from three aspects: time scale adjustment, periodic encoding, and time period span encoding, a time encoder for processing multi-scale and large-span time period information is designed.

[0186] Therefore, the present invention adopts the above method for constructing an implicit reasoning model of a geographical knowledge graph considering time period features. By analyzing the influence of different time scale scaling methods on the performance of the time period encoder, and by comparing the performance of different models on the geological sample age knowledge graph, the ability of the time period encoding method to extract time period features and its effectiveness in improving the performance of geographical logic queries of the knowledge graph are further verified.

[0187] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that they can still modify or equivalently replace the technical solutions of the present invention, and these modifications or equivalent replacements cannot make the modified technical solutions deviate from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for constructing an implicit reasoning model of a geographical knowledge graph considering time period characteristics, characterized in that, Including the following steps: S1. Construct a multi-scale geological sample dataset; S2. Establish an implicit inference model considering time period characteristics; S3. Evaluate the model performance through evaluation metrics and analyze the experimental results; 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 of the sample, and its specific geographical location, including the continent, country, longitude and latitude where the sample is located, and the note information related to its geographical location; For each sample, use the geological time interpretation algorithm to obtain the geological age spectrum, specific start time, end time, and corresponding uncertainty references by the geological sample; S12. Data preprocessing: Each sample in the geological sample dataset records the corresponding time information: the geological age time 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 million years ago (Ma), and multiply this data by -1×10 6 ; For the time in the PrimaryReference column, use a regular expression to extract the year in this column. After extracting all the times, convert them into the general form of year-month-day-hour-minute-second; By creating an increasing integer sequence NewIDNumber, assign a unique ID to each record, which is used as the sample name to connect geographical location, time information, and lithology description; S13. Knowledge graph construction: Determine the entities and the relationships between entities in the knowledge graph. By specifying the relationships between each column of entities, form triples and convert them into nodes and edges in the graph; through the normalization of time tags and the mapping of geographical coordinates, complete the attribute assignment of sample nodes; S14. Q&A dataset construction: Divide the triples in the knowledge graph into a training set, a test set, and a validation set according to the ratio of 90:9:1, and construct query-answer pairs L of the geological sample dataset after sampling QA ; Step S2 specifically includes the following steps: S21. Design a time encoder Enc for time period features (p) (); Encode time periods with complex time attributes. The time period characteristics include start time, end time, span, and periodicity. Consider time points as special time periods, that is, the start time of the time period is equal to the end time; for the time information in these two dimensions of time points and time periods, express the time points in the form of time periods, that is, perform dimension elevation; The feature extraction and combination of time periods will be considered from three aspects: time scale adjustment, periodic encoding, and time period span encoding; S22. Construct an implicit inference model of a geographical knowledge graph considering time period characteristics; TFKGE: An Implicit Reasoning Model of Geographic Knowledge Graph Considering Temporal Segment Features period It 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 temporal segment feature encoder, which respectively encode the entity features and temporal segment features of the knowledge graph, and then combine them into an entity vector containing temporal segment features. The projection operator is used to calculate the projection of the entity vector on the relation vector to obtain a 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 nearest neighbor search. S23. Model training; Train TFKGE on the basis of the newly constructed geological sample dataset period model and multiple parametric models, and then compare with the baseline model on the Yago15k dataset to test the contribution of the TFKGE period model in the geographical logical question answering task; In step S21, the specific process of the time scale adjustment is as follows: Shrink the scale of the start and end times by applying different logarithmic functions to the time values. Define two time scaling functions S(t): The first order-of-magnitude scaling method S based on logarithmic adjustment (l) (t), and the specific process is as follows: First, use the logarithmic function to determine a reference value, and then scale all the data according to this reference value, retaining the relative size relationship of the original data; by combining logarithmic transformation and order-of-magnitude scaling, mitigate the order-of-magnitude differences that may be caused by cross-scale time data when input into the deep learning model; Among them, represents the floor operation, and t min represents the minimum time value in the dataset or a manually specified reference value; The second absolute value logarithmic transformation method S (k) (t), and the specific process is as follows: By using the absolute value ∣t∣, it is ensured that even if t is negative, ∣t∣ + c is positive, enabling the function to take values within the domain. Through logarithmic transformation log k , the time data is mapped to a new scale: S (k) (t) = log k (|t| + c) (2) Among them, k and c are adjusted parameters used to control the degree and offset of scaling; In step S21, the periodic encoding is specifically: The 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) where ω represents the angular frequency vector of periodicity, which is used to capture the periodicity of different granularities in time t; In step S21, the time period span encoding is specifically as follows: 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 positions 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 start time and end time embeddings; By combining the embedding combination and embedding difference methods, rich features in the time period are captured through the start time and end time of the time period: E avg = (E start + E end ) / 2 (4) E diff = E end - E start (5) Among them, E start is the embedding vector representing the start time of the time period, E end is the embedding vector representing the end time of the time period, E avg is the mean value of the time period embedding vector, E diff represents the difference between the end time embedding and the start time embedding of the time period; Combine E start , E end , E diff , E avg and the periodic coding P(t) together to form a comprehensive feature vector E period , and then send this feature vector into a feedforward neural network for training to obtain the final time period coding E time : E period = [E start ; E end ; E diff ; E 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, P(t start ) and P(t end ) represent the periodic encodings of the start time and the end time respectively.

2. The method for constructing an implicit reasoning model of a geographical knowledge graph considering time period characteristics according to claim 1, characterized in that, In step S3, the evaluation metrics include the area under the ROC curve AUC and the average percentile rank APR; The AUC measures the ability of the model to distinguish correct answers from random negative samples by calculating the ROC curve and obtaining the area under the curve; The APR measures the relative ranking of the model in giving correct answers to all queries by calculating the average percentile rank of the correct answers in the model predictions.