A knowledge graph and agent driven spatio-temporal question answering method and system

By constructing a knowledge graph and an agent-driven spatiotemporal question-answering method, the shortcomings of existing platforms in effectively answering complex questions are addressed, enabling accurate and personalized responses to complex user queries and improving the accuracy and user experience of spatiotemporal question answering.

CN119623591BActive Publication Date: 2025-11-28WUHAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410292079.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-14
Publication Date
2025-11-28
Estimated Expiration
2044-03-14

AI Technical Summary

Technical Problem

Existing time-space question-and-answer platforms struggle to effectively answer complex "how to do it" type questions and lack the ability to respond to complex user queries.

Method used

This paper proposes a spatiotemporal question-answering method driven by knowledge graphs and intelligent agents. By constructing samples of historical spatiotemporal domain data, operators, and spatial locations, the method optimizes the knowledge extraction model using the BERT model and softmax classifier, constructs a spatiotemporal knowledge graph by combining a semantic embedding model, and calculates the answer to the user query using cosine similarity ranking and quantized scoring.

Benefits of technology

It enables accurate and personalized answers to complex spatiotemporal questions, providing more accurate and better services and enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119623591B_ABST
    Figure CN119623591B_ABST
Patent Text Reader

Abstract

The method of the present application proposes a knowledge graph and intelligent agent driven space-time question and answer method and system. The present application constructs historical space-time field samples, and marks the corresponding answer text in the description text; a knowledge extraction model is constructed, and the historical space-time field samples are used to train the knowledge extraction model; the space-time field samples are constructed and input into the trained knowledge extraction model for knowledge extraction to obtain the answer text corresponding to each space-time field sample; the space-time knowledge graph is constructed through knowledge relationship combined with space-time field information; the word vector of each keyword is extracted and calculated from the space-time knowledge graph, and multiple similar nodes are retrieved; the final reply judgment calculation of the user input question sentence is carried out combined with the quantitative score of the user input question sentence. The present application combines intelligent agent with space-time question and answer, so that the space-time question and answer can provide more accurate and personalized services.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of spatio-temporal question answering, and particularly relates to a knowledge graph and agent driven spatio-temporal question answering method and system. BACKGROUND

[0002] A knowledge graph is a knowledge management architecture constructed in the form of "[entity]-[relationship]-[entity]", which is used to describe concepts, entities and their relationships in the objective world. One of its prominent features is that it can efficiently structure the management of domain entity relationship data, providing strong support for Internet semantic search and knowledge question answering.

[0003] An agent is a system with perception, reasoning, learning and execution capabilities. Its perception ability is achieved through sensors or data input, and its reasoning and learning capabilities rely on algorithms and models, enabling it to understand and adapt to different environments. One important feature of an agent is its autonomy, which enables it to make decisions and perform tasks independently to a certain extent without excessive human intervention. This makes the agent adaptable to different situations and provides potential for the development of intelligent question answering.

[0004] In the context of spatio-temporal geoscience, users often ask "how to do" type questions in addition to "what" type, "where" type and "when" type questions. Existing question answering platforms can only provide general answers to these types of questions, so the spatio-temporal question answering industry needs a method that can answer both relatively simple "what", "where" and "when" type questions and more complex "how to do" type questions. SUMMARY

[0005] To address the shortcomings of existing spatio-temporal question answering technology and to utilize knowledge graphs and agents to compensate for the lack of response capabilities in traditional spatio-temporal question answering, the present application proposes a knowledge graph and agent driven spatio-temporal question answering method and system.

[0006] The technical solution of the method of the present application is a knowledge graph and agent driven spatio-temporal question answering method, comprising:

[0007] Step 1: Construct samples of each historical spatio-temporal domain data, samples of each historical spatio-temporal domain operator, and samples of each historical spatio-temporal domain spatial location, and mark the start and end positions of the corresponding answer text in the description text;

[0008] Step 2: build a knowledge extraction model, input each historical spatio-temporal field sample for knowledge extraction, further build a knowledge extraction model loss function model, and obtain the trained knowledge extraction model by gradient descent method optimization training;

[0009] Step 3: build each spatio-temporal field data sample, each spatio-temporal field operator sample, and each spatio-temporal field space position sample by splicing the question text, and input them into the trained knowledge extraction model for knowledge extraction to obtain the answer text corresponding to each spatio-temporal field sample;

[0010] Step 4: build a spatio-temporal knowledge graph by combining spatio-temporal field information through knowledge relationship, and sequentially convert each node of the spatio-temporal knowledge graph using a semantic embedding model to obtain the semantic feature vector of each node in the spatio-temporal knowledge graph;

[0011] Step 5: calculate the word vector of each keyword of the user input question sentence, and filter multiple user reply nodes in the spatio-temporal knowledge graph as the preliminary retrieval result by combining the cosine similarity sorting method;

[0012] Step 6: combine the quantification score of the user input question sentence to calculate the final reply of the user input question sentence;

[0013] As preferred, step 1 builds each historical spatio-temporal field data sample, each historical spatio-temporal field operator sample, and each historical spatio-temporal field space position sample, as follows:

[0014] Obtain the description text of multiple historical spatio-temporal field data, the description text of multiple historical spatio-temporal field operators, and the description text of multiple historical spatio-temporal field space positions by encapsulating the API services of multiple historical spatio-temporal field data, multiple historical spatio-temporal field operators, and multiple historical spatio-temporal field space positions;

[0015] Define multiple question texts for each historical spatio-temporal field data, and concatenate the multiple question texts for each historical spatio-temporal field data with the description text of each historical spatio-temporal field data to obtain the sample of each historical spatio-temporal field data;

[0016] Define multiple question texts for each historical spatio-temporal field operator, and concatenate the multiple question texts for each historical spatio-temporal field operator with the description text of each historical spatio-temporal field operator to obtain the sample of each historical spatio-temporal field operator;

[0017] Define multiple question texts for each historical spatio-temporal field space position, and concatenate the multiple question texts for each historical spatio-temporal field space position with the description text of each historical spatio-temporal field space position to obtain the sample of each historical spatio-temporal field space position;

[0018] As preferred, the start position and the end position of the answer text of each question text in the description text of each historical spatio-temporal domain data are marked, and the corresponding answer text in the description text is marked, specifically as follows:

[0019] The start position and the end position of the answer text of each question text in the description text of each historical spatio-temporal domain data are marked, and the corresponding answer text in the description text is marked, specifically as follows:

[0020] The start position and the end position of the answer text of each question text in the description text of each historical spatio-temporal domain data are marked, and the corresponding answer text in the description text is marked, specifically as follows:

[0021] The start position and the end position of the answer text of each question text in the description text of each historical spatio-temporal domain data are marked, and the corresponding answer text in the description text is marked, specifically as follows:

[0022] As preferred, the start position and the end position of the answer text of each question text in the description text of each historical spatio-temporal domain data are marked, and the corresponding answer text in the description text is marked, specifically as follows:

[0023] The start position and the end position of the answer text of each question text in the description text of each historical spatio-temporal domain data are marked, and the corresponding answer text in the description text is marked, specifically as follows:

[0024] The knowledge extraction model is constructed in step 2, specifically as follows:

[0025] The knowledge extraction model is constructed by connecting the BERT model with the first softmax classifier, the second softmax classifier and the sigmoid classifier in sequence.

[0026] The start position and the end position of the answer text of each question text in the description text of each historical spatio-temporal domain data are marked, and the corresponding answer text in the description text is marked, specifically as follows:

[0027] The start position and the end position of the answer text of each question text in the description text of each historical spatio-temporal domain data are marked, and the corresponding answer text in the description text is marked, specifically as follows:

[0028] The loss function model of the knowledge extraction model is constructed in step 2, specifically as follows:

[0029] The start position and the end position of the answer text of each question text of the sample of each historical spatio-temporal field data in the description text, the start position and the end position of the answer text of each question text of the sample of each historical spatio-temporal field operator in the description text, and the start position and the end position of the answer text of each question text of the sample of each historical spatio-temporal field space position in the description text are used to construct a knowledge extraction model loss function model, and a trained knowledge extraction model is obtained through gradient descent method optimization training.

[0030] The specific process of the knowledge extraction model in step 2 is as follows:

[0031] The sample of each spatio-temporal field data is input into the BERT model to calculate the word embedding, and the word embedding of each spatio-temporal field data sample is obtained and output to the first softmax classifier, the second softmax classifier and the sigmoid classifier respectively.

[0032] The first softmax classifier is used to convert the word embedding of each spatio-temporal field data sample through dimension conversion to obtain the start position of the answer text of each question text extracted by the sample of each historical spatio-temporal field data in the description text.

[0033] The second softmax classifier is used to convert the word embedding of each spatio-temporal field data sample through dimension conversion to obtain the end position of the answer text of each question text extracted by the sample of each historical spatio-temporal field data in the description text.

[0034] The sigmoid classifier is used to convert the word embedding of each spatio-temporal field data sample through dimension conversion to obtain a set of labels describing whether each start position and each end position correspond to the same answer text.

[0035] The sample of each spatio-temporal field operator is input into the BERT model to calculate the word embedding, and the word embedding of each spatio-temporal field operator sample is obtained and output to the first softmax classifier, the second softmax classifier and the sigmoid classifier respectively.

[0036] The first softmax classifier is used to convert the word embedding of each spatio-temporal field operator sample through dimension conversion to obtain the start position of the answer text of each question text extracted by the sample of each historical spatio-temporal field operator in the description text.

[0037] The second softmax classifier is used to convert the word embedding of each spatio-temporal field operator sample through dimension conversion to obtain the end position of the answer text of each question text extracted by the sample of each historical spatio-temporal field operator in the description text.

[0038] The sigmoid classifier is configured to convert the word embedding of each spatiotemporal field operator sample through dimension conversion to obtain a set of labels describing whether each start position and each end position correspond to the same answer text.

[0039] The sample of each spatiotemporal field spatial position is input into a BERT model to calculate word embedding to obtain the word embedding of each spatiotemporal field spatial position sample, which is respectively output to the first softmax classifier, the second softmax classifier, and the sigmoid classifier.

[0040] The first softmax classifier is configured to convert the word embedding of each spatiotemporal field spatial position sample through dimension conversion to obtain the start position of the answer text of each question text extracted by each historical spatiotemporal field spatial position sample in the description text.

[0041] The second softmax classifier is configured to convert the word embedding of each spatiotemporal field spatial position sample through dimension conversion to obtain the end position of the answer text of each question text extracted by each historical spatiotemporal field spatial position sample in the description text.

[0042] The sigmoid classifier is configured to convert the word embedding of each spatiotemporal field spatial position sample through dimension conversion to obtain a set of labels describing whether each start position and each end position correspond to the same answer text.

[0043] Preferably, the knowledge extraction model loss function model in step 2 is defined as follows:

[0044]

[0045] wherein, represents the knowledge extraction model loss function model, represents the loss function related to the historical spatiotemporal field data sample, represents the loss function related to the historical spatiotemporal field operator sample, represents the loss function related to the historical spatiotemporal field spatial position sample.

[0046] Preferably, the loss function related to the historical spatiotemporal field data sample is defined as follows:

[0047]

[0048] wherein, is the number of historical spatiotemporal field data samples input into the model, is the calculation result of the first softmax classifier of the i-th input historical spatiotemporal field data sample, the start token position index of the manually annotated answer text in the description text of the i th input historical spatio-temporal domain data sample, the second softmax classifier calculation result of the i th input historical spatio-temporal domain data sample, the end token position index of the manually annotated answer text in the description text of the i th input historical spatio-temporal domain data sample, the sigmoid classifier calculation result of the i th input historical spatio-temporal domain data sample, is the label of whether the start token of each answer text and the end token of each answer text in the manually annotated description text of the i th input historical spatio-temporal domain data sample match or not;

[0049] The loss function related to the historical spatio-temporal domain operator sample is defined as follows:

[0050]

[0051] wherein, is the number of historical spatio-temporal domain operator samples input into the model, the first softmax classifier calculation result of the i th input historical spatio-temporal domain operator sample, the start token position index of the manually annotated answer text in the description text of the i th input historical spatio-temporal domain operator sample, the second softmax classifier calculation result of the i th input historical spatio-temporal domain operator sample, the end token position index of the manually annotated answer text in the description text of the i th input historical spatio-temporal domain operator sample, the sigmoid classifier calculation result of the i th input historical spatio-temporal domain operator sample, is the label of whether the start token of each answer text and the end token of each answer text in the manually annotated description text of the i th input historical spatio-temporal domain operator sample match or not;

[0052] The loss function related to the historical spatio-temporal domain spatial position sample is defined as follows:

[0053]

[0054] wherein, is the number of historical spatio-temporal domain spatial position samples input into the model, the first softmax classifier calculation result of the i th input historical spatio-temporal domain spatial position sample, the start token position index of the artificially labeled answer text of the ith input historical spatio-temporal domain spatial position sample in the description text, the second softmax classifier calculation result of the ith input historical spatio-temporal domain spatial position sample, the end token position index of the artificially labeled answer text of the ith input historical spatio-temporal domain spatial position sample in the description text, the sigmoid classifier calculation result of the ith input historical spatio-temporal domain spatial position sample, is the label of the matching of the start token of each answer text and the end token of each answer text in the artificially labeled description text of the ith input historical spatio-temporal domain spatial position sample.

[0055] Preferably, the sample of each spatio-temporal domain data, the sample of each spatio-temporal domain operator, and the sample of each spatio-temporal domain spatial position are constructed by concatenating the question texts according to step 3, which are as follows:

[0056] The names, description texts of the plurality of spatio-temporal domain data, the names, description texts of the plurality of spatio-temporal domain operators, and the names, description texts of the plurality of spatio-temporal domain spatial positions are obtained by encapsulating the API services of the plurality of spatio-temporal domain data and the API services of the plurality of spatio-temporal domain operators.

[0057] The plurality of question texts of each spatio-temporal domain data are concatenated with the description text of each spatio-temporal domain data to obtain the sample of each spatio-temporal domain data, the plurality of question texts of each spatio-temporal domain operator are concatenated with the description text of each spatio-temporal domain operator to obtain the sample of each spatio-temporal domain operator, and the plurality of question texts of each spatio-temporal domain spatial position are concatenated with the description text of each spatio-temporal domain spatial position to obtain the sample of each spatio-temporal domain spatial position.

[0058] The answer text corresponding to each spatio-temporal domain sample is obtained by inputting to the trained knowledge extraction model for knowledge extraction according to step 3, which are as follows:

[0059] The samples of the plurality of spatiotemporal field data, the samples of the plurality of spatiotemporal field operators, and the samples of the plurality of spatiotemporal field spatial positions are input into the trained knowledge extraction model to extract the start and end positions of each answer text corresponding to the samples of the plurality of spatiotemporal field data, the start and end positions of the answer text corresponding to the samples of the plurality of spatiotemporal field operators, and the start and end positions of the answer text corresponding to the samples of the plurality of spatiotemporal field spatial positions. The start and end positions of each answer text corresponding to each sample of the spatiotemporal field data, the start and end positions of each answer text corresponding to each sample of the spatiotemporal field operator, and the start and end positions of each answer text corresponding to each sample of the spatiotemporal field spatial position are sequentially obtained by text splicing according to the start and end positions of each answer text corresponding to each sample of the spatiotemporal field data, each sample of the spatiotemporal field operator, and each sample of the spatiotemporal field spatial position.

[0060] Preferably, the spatiotemporal field information in step 4 comprises:

[0061] The name of each spatiotemporal field data obtained in step 3 is used as the name of each spatiotemporal field data node, the name of each spatiotemporal field operator obtained is used as the name of each spatiotemporal field operator node, the name of each spatiotemporal field spatial position obtained is used as the name of each spatiotemporal knowledge graph spatial position node, and each question text corresponding to each spatiotemporal field sample is used as the name of the question node of the spatiotemporal knowledge graph, and each answer text corresponding to each spatiotemporal field sample is used as the name of the answer node of the spatiotemporal knowledge graph.

[0062] Preferably, the spatiotemporal knowledge graph is constructed by the knowledge relationship in step 4, and the construction is as follows:

[0063] The spatiotemporal knowledge graph is composed of a plurality of nodes and connection relationships between the nodes. The nodes in the spatiotemporal knowledge graph include five types, namely, spatiotemporal field data nodes, spatiotemporal field operator nodes, spatiotemporal field spatial position nodes, question nodes, and answer nodes.

[0064] The knowledge relationship includes seven types, which are defined as follows:

[0065] Any one spatiotemporal field spatial position node contains any one spatiotemporal field spatial position node, any one spatiotemporal field spatial position node is adjacent to any one spatiotemporal field spatial position node, any one question node is directed to any one spatiotemporal field data node, any one question node is directed to any one spatiotemporal field operator node, any one question node is directed to any one spatiotemporal field spatial position node, any one answer node answers any one question node, and any one spatiotemporal field data node is about any one spatiotemporal field spatial position node.

[0066] Preferably, the word vector of each keyword of the user input question sentence is calculated according to the user input question sentence in step 5, and the calculation is as follows:

[0067] extracting, by the large language model, entities from the question sentence input by the user to obtain a plurality of keywords of the question sentence input by the user, and calculating word vectors of each keyword of the question sentence input by the user by using a semantic embedding model;

[0068] The combination cosine similarity sorting method in step 5 screens a plurality of user reply nodes in the spatiotemporal knowledge graph as the preliminary retrieval result, and the specific process is as follows:

[0069] The cosine similarity between the word vector of each keyword of the question sentence input by the user and the semantic feature vector of all nodes in the spatiotemporal knowledge graph is calculated, and the nodes with the highest cosine similarity are screened out according to the cosine similarity from high to low;

[0070] All first-order neighbor nodes of each node with the highest similarity are obtained through the relationship between the nodes in the spatiotemporal knowledge graph, the K nodes with the highest similarity and all first-order neighbor nodes of the K nodes with the highest similarity are defined as user reply nodes, and all attribute information of the plurality of user reply nodes is defined as the preliminary retrieval result;

[0071] As a preferred embodiment, step 6 combines the quantitative score of the question sentence input by the user to determine the final reply to the question sentence input by the user, and the specific process is as follows:

[0072] The question sentence input by the user and the preliminary retrieval result are input into the large language model for calculation to obtain the quantitative score of the preliminary retrieval result to the question sentence input by the user;

[0073] The quantitative score of the preliminary retrieval result to the question sentence input by the user is calculated, and if the quantitative score is greater than a predefined score threshold, step 6.1 is entered, otherwise step 6.2 is entered;

[0074] Step 6.1: prompting the user to provide further information feedback through a dialog box, and enhancing the knowledge graph retrieval through the user feedback to further optimize the reply;

[0075] Step 6.2: inputting the preliminary retrieval result, the result of the spatiotemporal domain operator execution, and the question sentence input by the user into the large language model for text integration to obtain the final reply to the question sentence input by the user;

[0076] As a preferred embodiment, the result of the spatiotemporal domain operator execution in step 6.2 is calculated as follows:

[0077] According to the operator node contained in the preliminary search result and the question sentence input by the user, an agent based on a large language model is called to recall related spatio-temporal field operator APIs and related spatio-temporal field data APIs in a spatio-temporal field knowledge graph, and an HTTP request is constructed by using the agent to call the spatio-temporal field data APIs and the spatio-temporal field operator APIs to complete processing of related spatio-temporal field data by the spatio-temporal field operator, and obtain a result of execution of the spatio-temporal field operator.

[0078] The technical scheme of the system is a knowledge graph and agent driven spatio-temporal question and answer system, comprising:

[0079] A sample label construction module is configured to construct samples of each historical spatio-temporal field data, samples of each historical spatio-temporal field operator, and samples of each historical spatio-temporal field space position, and mark the start position and the end position of the corresponding answer text in the description text.

[0080] A knowledge extraction model training module is configured to construct a knowledge extraction model, input each historical spatio-temporal field sample for knowledge extraction, further construct a knowledge extraction model loss function model, and obtain a trained knowledge extraction model by gradient descent method optimization training.

[0081] An answer text extraction module is configured to construct samples of each spatio-temporal field data, samples of each spatio-temporal field operator, and samples of each spatio-temporal field space position by question text splicing, input into the trained knowledge extraction model for knowledge extraction to obtain the corresponding answer text of each spatio-temporal field sample.

[0082] A spatio-temporal knowledge graph construction module is configured to construct a spatio-temporal knowledge graph by knowledge relationship in combination with spatio-temporal field information, and convert each node of the spatio-temporal knowledge graph in turn by using a semantic embedding model to obtain semantic feature vectors of each node in the spatio-temporal knowledge graph.

[0083] A preliminary search result calculation module is configured to calculate word vectors of each keyword of the question sentence input by the user according to the question sentence input by the user, and screen multiple user reply nodes as preliminary search results in the spatio-temporal knowledge graph in combination with a cosine similarity sorting method.

[0084] A question sentence final reply determination module is configured to calculate a quantitative score of the preliminary search result answering the question sentence input by the user, and if the quantitative score is greater than a predefined score threshold, prompting the user to further feedback information through a dialogue box, enhancing knowledge graph retrieval by the information feedback by the user to further optimize the reply, otherwise inputting the preliminary search result, the result of execution of the spatio-temporal field operator, and the question sentence input by the user into a large language model for text integration to obtain a final reply to the question sentence input by the user.

[0085] The beneficial effects of the above technical solutions of the present application are as follows:

[0086] The present application can automatically construct a knowledge graph, and use the knowledge graph and an agent to execute a spatiotemporal domain operator according to a user input question, take the result of the execution of the spatiotemporal domain operator as an enhancement to reply to the user input question, and thus provide more accurate and personalized services. BRIEF DESCRIPTION OF DRAWINGS

[0087] Figure 1 Method flowchart of the embodiment of the present application.

[0088] Figure 2 Experimental result graph of the embodiment of the present application. DETAILED DESCRIPTION

[0089] The technical solutions in the embodiments of the present application will be described clearly and completely in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the present application.

[0090] The spatiotemporal domain operators selected in the present embodiment are derived from the Google Earth Engine operator library and the open-source spatiotemporal operator model in Github, and the map base map adopted is the OpenStreetMap open street map.

[0091] One of the plurality of historical spatiotemporal domain data samples, the plurality of historical spatiotemporal domain operator samples, and the plurality of historical spatiotemporal domain spatial position samples labeled in the present embodiment is shown in the following figure:

[0092] {

[0093] Question text: ["introduction to the spatial position of the spatiotemporal domain, latitude and longitude of the spatial position of the spatiotemporal domain, approximate range of the spatial position of the spatiotemporal domain, natural features of the spatial position of the spatiotemporal domain, human features of the spatial position of the spatiotemporal domain"];

[0094] Description text: ["Wuhan University of Information Science is located at No. 129 Luoyu Road, Hongshan District, Wuhan City, and is located at Jieluokou and Guangbutun, with approximate latitude and longitude of 30°31'N and 114°21'E.

[0095] Wuhan University of Information Science was originally Wuhan University of Surveying, Mapping and Geomatics. After the merger of the original Wuhan University, Wuhan University of Water Resources and Electric Power, Wuhan University of Surveying, Mapping and Geomatics, and Hubei Medical University into a new Wuhan University in 2000, it became the Department of Information Science of Wuhan University.

[0096] Wuhan University Information Department contains Star Lake, surrounded by cherry trees, stone trees, French banyan trees, etc. The department has a wide green area, fresh air, and a good environment. Wuhan University Information Department has six colleges and one room, namely Computer College, Remote Sensing Information Engineering College, Electronic Information College, National Network Security College, Surveying and Mapping College, Resource and Environmental Science College, and Surveying and Mapping Remote Sensing Information Engineering State Key Laboratory. The atmosphere is good.

[0097] }

[0098] The start position and end position of the answer text of each question text of the marked sample in the description text are as shown in Figure 1

[0099] One of the plurality of spatiotemporal field data samples, the plurality of spatiotemporal field operator samples, and the plurality of spatiotemporal field space position samples constructed in the embodiment is as follows:

[0100] {

[0101] Question text: ["Main role of spatiotemporal field operator, spatiotemporal range applicable to spatiotemporal field operator, requirement of spatiotemporal field operator on input data, output data of spatiotemporal field operator, working principle of spatiotemporal field operator"];

[0102] Description text: ["ee.Geometry.BBox: constructs a rectangle whose edges are meridians and parallels. The result is a planar WGS84 rectangle. If (east-west) > 360, the longitude range will be normalized to -180 to +180; otherwise they will be treated as specified points on a circle (for example, east may be numerically smaller than west). Four input parameters (west, south, east, north) are required, and their data types are (Number, Number, Number, Number). west represents the westernmost longitude, which will be adjusted to -180 to 180; south represents the southernmost closed latitude, which will be considered as 90 if less than -90 (south pole); east represents the easternmost longitude; north represents the northernmost closed latitude, which will be considered as +90 if greater than +90 (north pole). The return value is Geometry.BBox."]

[0103] }

[0104] In this embodiment, the user input question sentence is "Help me find all the La Mian restaurants within 3km of the Wuhan University Information Department";

[0105] The following will be described in combination with the accompanying Figures 1-2 ​The embodiment of the present application is a knowledge graph and intelligent agent collaborative driving spatio-temporal question answering method, which is specifically as follows.

[0106] As Figure 1 The method flowchart of the embodiment of the present application is shown.

[0107] Step 1: constructing a sample of each historical spatio-temporal field data, a sample of each historical spatio-temporal field operator, and a sample of each historical spatio-temporal field space position, and marking the start position and end position of the corresponding answer text in the description text;

[0108] Step 1: constructing a sample of each historical spatio-temporal field data, a sample of each historical spatio-temporal field operator, and a sample of each historical spatio-temporal field space position, and marking the start position and end position of the corresponding answer text in the description text;

[0109] By encapsulating the API services of the plurality of historical spatio-temporal field data, the API services of the plurality of historical spatio-temporal field operators, the description text of the plurality of historical spatio-temporal field data, the description text of the plurality of historical spatio-temporal field operators, and the description text of the plurality of historical spatio-temporal field space positions are obtained;

[0110] A plurality of question texts of each historical spatio-temporal field data are defined, and the plurality of question texts of each historical spatio-temporal field data are text-spliced with the description text of each historical spatio-temporal field data to obtain a sample of each historical spatio-temporal field data;

[0111] A plurality of question texts of each historical spatio-temporal field operator are defined, and the plurality of question texts of each historical spatio-temporal field operator are text-spliced with the description text of each historical spatio-temporal field operator to obtain a sample of each historical spatio-temporal field operator;

[0112] A plurality of question texts of each historical spatio-temporal field space position are defined, and the plurality of question texts of each historical spatio-temporal field space position are text-spliced with the description text of each historical spatio-temporal field space position to obtain a sample of each historical spatio-temporal field space position;

[0113] Step 1: marking the start position and end position of the corresponding answer text in the description text, which is specifically as follows:

[0114] In the description text of each historical spatio-temporal field data, the start position and end position of the answer text of each question text of the sample of each historical spatio-temporal field data in the description text are marked;

[0115] In the description text of each historical spatio-temporal field operator, the start position and end position of the answer text of each question text of the sample of each historical spatio-temporal field operator in the description text are marked;

[0116] The start position and the end position of the answer text of each question text extracted from each historical spatio-temporal field space position in the description text are marked in the description text of the spatial position of each historical spatio-temporal field space position;

[0117] Step 2: Constructing a knowledge extraction model, sequentially inputting each sample of historical spatio-temporal field data, each sample of historical spatio-temporal field operator and each sample of historical spatio-temporal field space position into the knowledge extraction model for knowledge extraction, obtaining the start position and the end position of the answer text of each question text extracted in the description text, constructing a loss function model of the knowledge extraction model, and obtaining the trained knowledge extraction model through gradient descent method optimization training;

[0118] Step 2 of constructing the knowledge extraction model is as follows:

[0119] The knowledge extraction model is constructed by connecting the BERT model with the first softmax classifier, the second softmax classifier and the sigmoid classifier in sequence.

[0120] Step 2 of sequentially inputting into the knowledge extraction model for knowledge extraction to obtain the start position and the end position of the answer text of each question text extracted in the description text is as follows:

[0121] Each sample of spatio-temporal field data, each sample of spatio-temporal field operator and each sample of spatio-temporal field space position are input into the knowledge extraction model for knowledge extraction in sequence, and the start position and the end position of the answer text of each question text extracted in the description text are obtained.

[0122] Step 2 of constructing the loss function model of the knowledge extraction model is as follows:

[0123] The start position and the end position of the answer text of each question text extracted in the description text of each historical spatio-temporal field data sample, the start position and the end position of the answer text of each question text extracted in the description text of each historical spatio-temporal field operator sample, and the start position and the end position of the answer text of each question text extracted in the description text of each historical spatio-temporal field space position sample are sequentially combined to construct the loss function model of the knowledge extraction model, and the trained knowledge extraction model is obtained through gradient descent method optimization training.

[0124] The specific process of knowledge extraction of the knowledge extraction model in step 2 is as follows:

[0125] The sample of each spatiotemporal domain data is input into a BERT model to calculate word embedding, to obtain the word embedding of the sample of each spatiotemporal domain data, which is respectively output to a first softmax classifier, a second softmax classifier and a sigmoid classifier;

[0126] The first softmax classifier is configured to perform dimension conversion on the word embedding of the sample of each spatiotemporal domain data, to obtain a starting position of an answer text of each question text extracted by the sample of each historical spatiotemporal domain data in a description text;

[0127] The second softmax classifier is configured to perform dimension conversion on the word embedding of the sample of each spatiotemporal domain data, to obtain an ending position of the answer text of each question text extracted by the sample of each historical spatiotemporal domain data in the description text;

[0128] The sigmoid classifier is configured to perform dimension conversion on the word embedding of the sample of each spatiotemporal domain data, to obtain a set of labels describing whether each starting position and each ending position correspond to the same answer text.

[0129] The sample of each spatiotemporal domain operator is input into a BERT model to calculate word embedding, to obtain the word embedding of the sample of each spatiotemporal domain operator, which is respectively output to a first softmax classifier, a second softmax classifier and a sigmoid classifier;

[0130] The first softmax classifier is configured to perform dimension conversion on the word embedding of the sample of each spatiotemporal domain operator, to obtain a starting position of an answer text of each question text extracted by the sample of each historical spatiotemporal domain operator in a description text;

[0131] The second softmax classifier is configured to perform dimension conversion on the word embedding of the sample of each spatiotemporal domain operator, to obtain an ending position of the answer text of each question text extracted by the sample of each historical spatiotemporal domain operator in the description text;

[0132] The sigmoid classifier is configured to perform dimension conversion on the word embedding of the sample of each spatiotemporal domain operator, to obtain a set of labels describing whether each starting position and each ending position correspond to the same answer text.

[0133] The sample of each spatiotemporal domain spatial position is input into a BERT model to calculate word embedding, to obtain the word embedding of the sample of each spatiotemporal domain spatial position, which is respectively output to a first softmax classifier, a second softmax classifier and a sigmoid classifier;

[0134] The first softmax classifier is configured to convert the word embedding of the sample of each spatiotemporal field space position through dimension conversion to obtain a start position of the answer text of each question text extracted by the sample of each historical spatiotemporal field space position in the description text.

[0135] The second softmax classifier is configured to convert the word embedding of the sample of each spatiotemporal field space position through dimension conversion to obtain an end position of the answer text of each question text extracted by the sample of each historical spatiotemporal field space position in the description text.

[0136] The sigmoid classifier is configured to convert the word embedding of the sample of each spatiotemporal field space position through dimension conversion to obtain a set of labels describing whether each start position and each end position correspond to the same answer text.

[0137] The knowledge extraction model loss function model in step 2 is defined as follows:

[0138]

[0139] wherein, represents the knowledge extraction model loss function model, represents a loss function related to the historical spatiotemporal field data sample, represents a loss function related to the historical spatiotemporal field operator sample, represents a loss function related to the historical spatiotemporal field space position sample;

[0140] The loss function related to the historical spatiotemporal field data sample is defined as follows:

[0141]

[0142] wherein, is the number of historical spatiotemporal field data samples input into the model, is a first softmax classifier calculation result of the i-th input historical spatiotemporal field data sample, is a start token position index of an artificially labeled answer text in the description text of the i-th input historical spatiotemporal field data sample, is a second softmax classifier calculation result of the i-th input historical spatiotemporal field data sample, is an end token position index of the artificially labeled answer text in the description text of the i-th input historical spatiotemporal field data sample, is a sigmoid classifier calculation result of the i-th input historical spatiotemporal field data sample, is the label of whether the start token and the end token of each answer text in the artificially annotated description text of the i-th input historical spatio-temporal domain data sample match or not.

[0143] The loss function related to the historical spatio-temporal domain operator sample is defined as follows:

[0144]

[0145] wherein, is the number of historical spatio-temporal domain operator samples input into the model, is the first softmax classifier calculation result of the i-th input historical spatio-temporal domain operator sample, is the start token position index of the artificially annotated answer text in the description text of the i-th input historical spatio-temporal domain operator sample, is the second softmax classifier calculation result of the i-th input historical spatio-temporal domain operator sample, is the end token position index of the artificially annotated answer text in the description text of the i-th input historical spatio-temporal domain operator sample, is the sigmoid classifier calculation result of the i-th input historical spatio-temporal domain operator sample, is the label of whether the start token and the end token of each answer text in the artificially annotated description text of the i-th input historical spatio-temporal domain data sample match or not.

[0146] The loss function related to the historical spatio-temporal domain spatial position sample is defined as follows:

[0147]

[0148] wherein, is the number of historical spatio-temporal domain spatial position samples input into the model, is the first softmax classifier calculation result of the i-th input historical spatio-temporal domain spatial position sample, is the start token position index of the artificially annotated answer text in the description text of the i-th input historical spatio-temporal domain spatial position sample, is the second softmax classifier calculation result of the i-th input historical spatio-temporal domain spatial position sample, is the end token position index of the artificially annotated answer text in the description text of the i-th input historical spatio-temporal domain spatial position sample, is the sigmoid classifier calculation result of the i-th input historical spatio-temporal domain spatial position sample, is a label of matching or not matching of a start token of each answer text in the artificially labeled description text of the historical spatio-temporal field space position sample of the i th input and an end token of each answer text.

[0149] Step 3: constructing each spatio-temporal field data sample, each spatio-temporal field operator sample, and each spatio-temporal field space position sample by question text splicing, and inputting into the trained knowledge extraction model to extract knowledge to obtain the corresponding answer text of each spatio-temporal field sample;

[0150] Step 3 of constructing each spatio-temporal field data sample, each spatio-temporal field operator sample, and each spatio-temporal field space position sample by question text splicing is as follows:

[0151] By encapsulating the API service of obtaining multiple spatio-temporal field data, the API service of multiple spatio-temporal field operators, the name, description text of multiple spatio-temporal field data, the name, description text of multiple spatio-temporal field operators, the name, description text of multiple spatio-temporal field space positions are obtained;

[0152] Text splicing is performed on each spatio-temporal field data multiple question texts and the description text of each spatio-temporal field data to obtain each spatio-temporal field data sample, and text splicing is performed on each spatio-temporal field operator multiple question texts and the description text of each spatio-temporal field operator to obtain each spatio-temporal field operator sample; text splicing is performed on each spatio-temporal field space position multiple question texts and the description text of each spatio-temporal field space position to obtain each spatio-temporal field space position sample;

[0153] Step 3 of inputting into the trained knowledge extraction model to extract knowledge to obtain the corresponding answer text of each spatio-temporal field sample is as follows:

[0154] The multiple spatio-temporal field data samples, multiple spatio-temporal field operator samples, and multiple spatio-temporal field space position samples are input into the trained knowledge extraction model, and the start and end positions of each answer text corresponding to the multiple spatio-temporal field data samples, the start and end positions of the answer text corresponding to the multiple spatio-temporal field operator samples, and the start and end positions of the answer text corresponding to the multiple spatio-temporal field space position samples are extracted. According to the start and end positions of each answer text corresponding to each spatio-temporal field data sample, spatio-temporal field operator sample, and spatio-temporal field space position sample, each answer text corresponding to each spatio-temporal field data sample, each answer text corresponding to the spatio-temporal field operator sample, and each answer text corresponding to the spatio-temporal field space position sample are obtained by text splicing.

[0155] Step 4: combine the spatio-temporal field information to construct a spatio-temporal knowledge graph, and then convert each node of the spatio-temporal knowledge graph into a semantic feature vector by using a semantic embedding model;

[0156] The spatio-temporal field information of step 4 includes:

[0157] The name of each spatio-temporal field data obtained in step 3 is used as the name of each spatio-temporal field data node, the name of each spatio-temporal field operator obtained is used as the name of each spatio-temporal field operator node, the name of each spatio-temporal field space position obtained is used as the name of each spatio-temporal knowledge graph space position node, each question text corresponding to each spatio-temporal field sample is used as the name of the question node of the spatio-temporal knowledge graph, and each answer text corresponding to each spatio-temporal field sample is used as the name of the answer node of the spatio-temporal knowledge graph.

[0158] Step 4: construct a spatio-temporal knowledge graph through knowledge relationships, specifically as follows:

[0159] The spatio-temporal knowledge graph is composed of multiple nodes and connection relationships between the nodes, and the nodes in the spatio-temporal knowledge graph include five types, namely spatio-temporal field data nodes, spatio-temporal field operator nodes, spatio-temporal field space position nodes, question nodes, and answer nodes.

[0160] The knowledge relationship includes seven types, defined as follows:

[0161] Any one spatio-temporal field space position node contains any one spatio-temporal field space position node, any one spatio-temporal field space position node is adjacent to any one spatio-temporal field space position node, any one question node is directed to any one spatio-temporal field data node, any one question node is directed to any one spatio-temporal field operator node, any one question node is directed to any one spatio-temporal field space position node, any one answer node answers any one question node, and any one spatio-temporal field data node is about any one spatio-temporal field space position node.

[0162] Step 5: Perform entity extraction on the user input question sentence through a large language model to obtain a plurality of keywords of the user input question sentence as ["Wuhan University Information Department", "within 3 km", "La Mian Xiaolong Hot Pot Restaurant"], calculate the word vector of each keyword of the user input question sentence using a semantic embedding model, calculate the cosine similarity between the word vector of each keyword of the user input question sentence and the semantic feature vector of all nodes of the spatio-temporal knowledge graph, sort according to the cosine similarity from high to low, and filter to obtain the top K nodes with the highest cosine similarity, and obtain all first-order neighbor nodes of each node with the highest similarity through the relationship between the nodes in the spatio-temporal knowledge graph. The K nodes with the highest similarity and all first-order neighbor nodes of the K nodes with the highest similarity are defined as user reply nodes, and all attribute information of the plurality of user reply nodes is defined as a preliminary retrieval result. The user input question sentence and the preliminary retrieval result are input into a large language model for calculation to obtain a quantitative score of the preliminary retrieval result answering the user input question sentence, which is further compared with a predefined score threshold 90. If the quantitative score of the preliminary retrieval result answering the user input question sentence is greater than or equal to the predefined score threshold, step 6 is entered, otherwise step 7 is entered.

[0163] In this embodiment, K is 3. The quantitative score of the preliminary retrieval result answering the user input question sentence is 84, which is less than 90, so step 7 is entered.

[0164] Step 6: Prompt the user for further information feedback through a dialog box, and enhance knowledge graph retrieval through user feedback information to further optimize the reply.

[0165] Step 7: According to the operator nodes contained in the preliminary retrieval result and the user input question sentence, call an intelligent agent based on a large language model to recall relevant spatio-temporal field operator APIs and relevant spatio-temporal field data APIs in the spatio-temporal field knowledge graph, obtain buffer zone analysis operator API, Wuhan Hongshan District map data API, Wuhan map data API, and La Mian Xiaolong Hot Pot Restaurant store distribution data API, and use the intelligent agent to construct an HTTP request to call the above-mentioned spatio-temporal field data APIs and the above-mentioned spatio-temporal field operator APIs to complete the processing of the above-mentioned spatio-temporal field data by the above-mentioned spatio-temporal field operator, and obtain the result of the execution of the buffer zone analysis operator.

[0166] Input the preliminary retrieval result, the result of the execution of the buffer zone analysis operator, and the user input question sentence into a large language model for text integration to obtain the final reply to the user input question sentence:

[0167] ["OK, here are the locations of all La Mian Xiaolong Hot Pot Restaurants within 3 km of Wuhan University Information Department:

[0168] • La Mian Xiaolongguo Hotpot (Yintai Creative City Store): No. 35, Luyu Road, Luonan Street, Hongshan District, Wuhan City, Hubei Province, Yintai Creative City 9F011 Shop.

[0169] • La Mian Xiaolongguo Hotpot (Qun Guang Square Store): No. 6, Qun Guang Square, Luoyu Road, Hongshan District, Wuhan City, Hubei Province.

[0170] • La Mian Xiaolongguo Hotpot (Fanyue City Outlets Store): No. 425, Fanyue City Outlets, Luoshi Road, Hongshan District, Wuhan City, Hubei Province.

[0171] • La Mian Xiaolongguo Hotpot (Wuchang Yatao Store): No. 628, Wuchang Yatao Square, Wuluo Road, Wuchang District, Wuhan City, Hubei Province.

[0172] • La Mian Xiaolongguo Hotpot (Zhongshang Department Store): 9th Floor, Zhongshang Department Store, Zhongnan Road, Wuchang District, Wuhan City, Hubei Province.

[0173] If you have further needs, please let me know.

[0174] Preferably, the step 1 marks the answer text in the description text of multiple spatio-temporal field data, the description text of multiple spatio-temporal field operators, and the description text of multiple spatio-temporal field spatial positions, specifically including:

[0175] For the description text of spatio-temporal field data, the content of the data, the sensor used to collect the data, the time range covered by the data, the spatial range covered by the data, and the data format of the data are marked;

[0176] For the description text of spatio-temporal field operator, the main function of spatio-temporal field operator, the spatio-temporal range applicable to spatio-temporal field operator, the requirement of spatio-temporal field operator on input data, the output data of spatio-temporal field operator, and the working principle of spatio-temporal field operator are marked;

[0177] For the description text of spatio-temporal field spatial position, the introduction of spatio-temporal field spatial position, the latitude and longitude of spatio-temporal field spatial position, the location of spatio-temporal field spatial position, the natural characteristics of spatio-temporal field spatial position, and the humanistic characteristics of spatio-temporal field spatial position are marked;

[0178] The spatio-temporal knowledge graph in step 4 is defined as follows:

[0179]

[0180] wherein represents a node set, represents a relationship set. Wherein, , wherein represent data nodes, operator nodes, spatial position nodes, question nodes, and answer nodes, respectively; , respectively represent the mutual relationship between each type of node.

[0181] attached Figure 2 For a specific implementation scenario of the result graph returned according to the input natural language question sentence of the user in the application, it can be seen that the application can complete the user's demand in the space-time field according to the user's natural language question sentence, and realizes the accurate question reply ability.

[0182] The embodiment of the system is a knowledge graph and intelligent agent driven space-time question answering system, comprising:

[0183] The sample label construction module is used for constructing samples of each historical space-time field data, samples of each historical space-time field operator, samples of each historical space-time field space position, and marking the start position and end position of the corresponding answer text in the description text.

[0184] The knowledge extraction model training module is used for constructing a knowledge extraction model, inputting each historical space-time field sample for knowledge extraction, further constructing a knowledge extraction model loss function model, and obtaining the trained knowledge extraction model through gradient descent method optimization training.

[0185] The answer text extraction module is used for constructing samples of each space-time field data, samples of each space-time field operator, and samples of each space-time field space position by splicing the question text, and inputting the samples into the trained knowledge extraction model for knowledge extraction to obtain the corresponding answer text of each space-time field sample.

[0186] The space-time knowledge graph construction module is used for constructing a space-time knowledge graph by combining space-time field information through knowledge relationship, and transforming each node of the space-time knowledge graph in turn by using a semantic embedding model to obtain the semantic feature vector of each node in the space-time knowledge graph.

[0187] The preliminary retrieval result calculation module is used for calculating the word vector of each keyword of the question sentence input by the user according to the question sentence input by the user, and screening multiple user reply nodes as preliminary retrieval results in the space-time knowledge graph by combining the cosine similarity sorting method.

[0188] The question sentence final reply determination module is used for calculating the quantitative score of the preliminary retrieval result answering the question sentence input by the user, and if the quantitative score is greater than the predefined score threshold, prompting the user to further feedback information through the dialogue box, enhancing the knowledge graph retrieval through the user feedback information to further optimize the reply, otherwise inputting the preliminary retrieval result, the result of the space-time field operator execution and the question sentence input by the user into the large language model for text integration to obtain the final reply of the question sentence input by the user.

[0189] The sample label construction module, the knowledge extraction model training module, the answer text extraction module, the space-time knowledge graph construction module, the preliminary retrieval result calculation module and the question sentence final reply determination module are all deployed on a server.

[0190] Although preferred embodiments of the application have been described herein, additional changes and modifications can be made by those skilled in the art once they learn of the basic inventive concepts. Therefore, the appended claims are intended to cover all such changes and modifications that fall within the scope of the application.

[0191] The above description of disclosed embodiments is intended to be illustrative, and not restrictive. Many embodiments will be apparent to those of skill in the art upon reviewing the above description. The scope of the application should, therefore, be determined not with reference to the above description, but instead with reference to the appended claims, along with their full scope of equivalents.

Claims

1. A spatiotemporal question-answering method driven by knowledge graphs and intelligent agents, characterized in that, Includes the following steps: Step 1: Construct samples of each historical spatiotemporal domain data, each historical spatiotemporal domain operator, and each historical spatiotemporal domain spatial location, and mark the start and end positions of the corresponding answer text in the description text; Step 2: Construct a knowledge extraction model. Take samples of each historical spatiotemporal domain data, samples of each historical spatiotemporal domain operator, and samples of each historical spatiotemporal domain spatial location as inputs for knowledge extraction. Obtain the start and end positions of the answer text in the description text for each extracted question text. Construct a loss function model for the knowledge extraction model and optimize the training using the gradient descent method to obtain the trained knowledge extraction model. Step 3: Construct samples of each spatiotemporal domain data, each spatiotemporal domain operator, and each spatiotemporal domain spatial location by concatenating the question text. Input these samples into the trained knowledge extraction model to extract the answer text corresponding to each spatiotemporal domain sample. Step 4: Combine spatiotemporal domain information to construct a spatiotemporal knowledge graph through knowledge relationships, and transform each node of the spatiotemporal knowledge graph sequentially using a semantic embedding model to obtain the semantic feature vector of each node in the spatiotemporal knowledge graph; Step 5: Calculate the word vector of each keyword in the user's input question statement, and use the cosine similarity ranking method to select multiple user response nodes in the spatiotemporal knowledge graph as preliminary search results; Step 6: Calculate the final response to the user's input question by combining the quantitative score of the question. Step 3 involves constructing samples for each spatiotemporal domain data, each spatiotemporal domain operator, and each spatiotemporal domain spatial location through concatenation of question text, as detailed below: By encapsulating API services for multiple spatiotemporal domain data and API services for multiple spatiotemporal domain operators, we can obtain the names and descriptions of multiple spatiotemporal domain data, multiple spatiotemporal domain operators, and multiple spatiotemporal domain spatial locations. The sample of each spatiotemporal domain data is obtained by concatenating multiple question texts of each spatiotemporal domain data with the description text of each spatiotemporal domain data. The sample of each spatiotemporal domain operator is obtained by concatenating multiple question texts of each spatiotemporal domain operator with the description text of each spatiotemporal domain operator. The sample of each spatiotemporal domain spatial location is obtained by concatenating multiple question texts of each spatiotemporal domain spatial location with the description text of each spatiotemporal domain spatial location. The spatiotemporal domain information mentioned in step 4 includes: The name of each spatiotemporal domain data obtained in step 3 is used as the name of each spatiotemporal domain data node, the name of each spatiotemporal domain operator is used as the name of each spatiotemporal domain operator node, the name of each spatiotemporal domain spatial location is used as the name of each spatiotemporal knowledge graph spatial location node, each question text corresponding to each spatiotemporal domain sample is used as the name of the question node of the spatiotemporal knowledge graph, and each answer text corresponding to each spatiotemporal domain sample is used as the name of the answer node of the spatiotemporal knowledge graph. Step 4, which involves constructing a spatiotemporal knowledge graph based on knowledge relationships, is detailed below: The spatiotemporal knowledge graph is composed of multiple nodes and the connections between nodes. The nodes in the spatiotemporal knowledge graph include five types: spatiotemporal domain data nodes, spatiotemporal domain operator nodes, spatiotemporal domain spatial location nodes, question nodes, and answer nodes. The knowledge relationships include 7 types, defined as follows: Any spatiotemporal spatial location node contains any spatiotemporal spatial location node; any spatiotemporal spatial location node is adjacent to any spatiotemporal spatial location node; any question node is related to any spatiotemporal data node; any question node is related to any spatiotemporal operator node; any question node is related to any spatiotemporal spatial location node; any answer node answers any question node; any spatiotemporal data node is related to any spatiotemporal spatial location node. Step 5 involves calculating the word vector for each keyword in the user-input question, as detailed below: The system extracts entities from the user-input question statement using a large language model, obtaining multiple keywords from the user-input question statement. Then, it uses a semantic embedding model to calculate the word vector of each keyword in the user-input question statement. Step 5 describes the use of cosine similarity ranking to select multiple user response nodes in the spatiotemporal knowledge graph as preliminary search results, as detailed below: Calculate the cosine similarity between the word vector of each keyword in the user's input question and the semantic feature vector of all nodes in the spatiotemporal knowledge graph. Sort the nodes according to the cosine similarity from high to low and select the top K nodes with the highest cosine similarity. By obtaining all first-order neighbor nodes of each node with the highest similarity through the relationship between nodes in the spatiotemporal knowledge graph, the K nodes with the highest similarity and all first-order neighbor nodes of the K nodes with the highest similarity are defined as user response nodes, and all attribute information of multiple user response nodes is defined as preliminary search results. Step 6 involves calculating the final response to the user's input question by combining the quantitative score of the question statement. The specific steps are as follows: The user's input question and preliminary search results are fed into the large language model for calculation, and a quantitative score is obtained for the preliminary search results in response to the user's input question. Calculate the quantitative score of the initial search results in response to the user's input question. If the quantitative score is greater than the predefined score threshold, proceed to step 6.1; otherwise, proceed to step 6.

2. Step 6.1: Prompt the user to provide further feedback through a dialog box, and enhance the knowledge graph retrieval based on the user's feedback to further optimize the response; Step 6.2: Input the preliminary search results, the results of the spatiotemporal domain operator execution, and the user's input question into the large language model for text integration to obtain the final response to the user's input question; The result of the spatiotemporal domain operator execution described in step 6.2 is calculated as follows: Based on the operator nodes contained in the preliminary search results and the question statement entered by the user, an agent based on a large language model is invoked to recall relevant spatiotemporal domain operator APIs and relevant spatiotemporal domain data APIs in the spatiotemporal domain knowledge graph. The agent is then used to construct an HTTP request to invoke the spatiotemporal domain data API and spatiotemporal domain operator API to complete the processing of relevant spatiotemporal domain data by the spatiotemporal domain operators, thereby obtaining the results of the spatiotemporal domain operator execution.

2. The knowledge graph and agent-driven spatiotemporal question answering method according to claim 1, characterized in that: Step 1 constructs samples for each historical spatiotemporal domain data, samples for each historical spatiotemporal domain operator, and samples for each historical spatiotemporal domain spatial location, as detailed below: By encapsulating API services for obtaining multiple historical spatiotemporal domain data and API services for obtaining multiple historical spatiotemporal domain operators, we can obtain descriptive text for multiple historical spatiotemporal domain data, descriptive text for multiple historical spatiotemporal domain operators, and descriptive text for multiple historical spatiotemporal domain spatial locations. Define multiple question texts for each historical spatiotemporal domain data, and concatenate the multiple question texts of each historical spatiotemporal domain data with the description text of each historical spatiotemporal domain data to obtain a sample of each historical spatiotemporal domain data. Define multiple question texts for each historical spatiotemporal domain operator, and concatenate the multiple question texts of each historical spatiotemporal domain operator with the description text of each historical spatiotemporal domain operator to obtain a sample of each historical spatiotemporal domain operator; Define multiple question texts for each historical spatiotemporal domain spatial location, and concatenate the multiple question texts for each historical spatiotemporal domain spatial location with the description text of each historical spatiotemporal domain spatial location to obtain a sample of each historical spatiotemporal domain spatial location.

3. The knowledge graph and agent-driven spatiotemporal question answering method according to claim 2, characterized in that: Step 1 involves marking the start and end positions of the corresponding answer text within the description text, as detailed below: Mark the start and end positions of the answer text for each question in the description text of each historical spatiotemporal domain data sample within the description text. In the description text of each historical spatiotemporal domain operator, mark the start and end positions of the answer text for each question text of each sample of the historical spatiotemporal domain operator in the description text; In the description text of each historical spatiotemporal domain spatial location, mark the start and end positions of the answer text for each question text for each historical spatiotemporal domain spatial location sample in the description text.

4. The knowledge graph and agent-driven spatiotemporal question answering method according to claim 3, characterized in that: Step 2 involves predicting each historical spatiotemporal domain sample input as follows: The sample of each historical spatiotemporal domain data, the sample of each historical spatiotemporal domain operator, and the sample of each historical spatiotemporal domain spatial location are used as inputs for knowledge extraction, and the start and end positions of the answer text of each extracted question text in the description text are obtained. Step 2, which involves constructing the knowledge extraction model, is as follows: A knowledge extraction model is constructed by sequentially connecting the BERT model with the first softmax classifier, the second softmax classifier, and the sigmoid classifier. Step 2 involves sequentially using these as inputs for knowledge extraction, obtaining the start and end positions of the answer text in the description text for each extracted question text, as detailed below: The samples of each spatiotemporal domain data, each spatiotemporal domain operator, and each spatiotemporal domain spatial location are input into the knowledge extraction model for knowledge extraction in sequence. The starting and ending positions of the answer text of each question text extracted from the samples of each historical spatiotemporal domain data, the starting and ending positions of the answer text of each question text extracted from the samples of each historical spatiotemporal domain operator, and the starting and ending positions of the answer text of each question text extracted from the samples of each historical spatiotemporal domain spatial location are obtained respectively. Step 2 involves constructing the loss function model for the knowledge extraction model, as detailed below: The knowledge extraction model loss function model is constructed by sequentially combining the start and end positions of the answer text of each question text in the description text of each sample of historical spatiotemporal domain data, the start and end positions of the answer text of each question text in the description text of each sample of historical spatiotemporal domain operators, and the start and end positions of the answer text of each question text in the description text of each sample of historical spatiotemporal domain spatial location. The trained knowledge extraction model is obtained by optimizing the training through gradient descent.

5. The knowledge graph and agent-driven spatiotemporal question answering method according to claim 4, characterized in that: The specific knowledge extraction process of the knowledge extraction model described in step 2 is as follows: Each spatiotemporal domain data sample is input into the BERT model to calculate word embeddings, and the word embeddings of each spatiotemporal domain data sample are output to the first softmax classifier, the second softmax classifier, and the sigmoid classifier respectively. The first softmax classifier is used to transform the word embeddings of each sample in the spatiotemporal domain data through dimensionality transformation to obtain the starting position of the answer text in the description text of each question text extracted from each historical spatiotemporal domain data sample. The second softmax classifier is used to transform the word embeddings of each sample in the spatiotemporal domain data through dimensionality transformation to obtain the end position of the answer text in the description text of each question text extracted from each historical spatiotemporal domain data sample. The sigmoid classifier is used to transform the word embeddings of each spatiotemporal domain data sample through dimensionality transformation to obtain a set of labels describing whether each start position and each end position correspond to the same answer text; The sample of each spatiotemporal domain operator is input into the BERT model to calculate the word embedding, and the word embedding of the sample of each spatiotemporal domain operator is obtained. The embeddings are then output to the first softmax classifier, the second softmax classifier, and the sigmoid classifier, respectively. The first softmax classifier is used to transform the word embeddings of each spatiotemporal domain operator sample through dimensionality transformation to obtain the starting position of the answer text in the description text of each question text extracted from the sample of each historical spatiotemporal domain operator. The second softmax classifier is used to transform the word embeddings of each spatiotemporal domain operator sample through dimensionality transformation to obtain the end position of the answer text in the description text of each question text extracted from the sample of each historical spatiotemporal domain operator. The sigmoid classifier is used to transform the word embeddings of each spatiotemporal domain operator sample through dimensionality transformation to obtain a set of labels describing whether each start position and each end position correspond to the same answer text; The sample of each spatiotemporal spatial location is input into the BERT model to calculate the word embedding, and the word embedding of the sample of each spatiotemporal spatial location is output to the first softmax classifier, the second softmax classifier, and the sigmoid classifier respectively. The first softmax classifier is used to transform the word embeddings of samples at each spatiotemporal spatial location to obtain the starting position of the answer text in the description text of each question text extracted from the samples at each historical spatiotemporal spatial location. The second softmax classifier is used to transform the word embeddings of samples at each spatiotemporal spatial location to obtain the end position of the answer text in the description text of each question text extracted from the samples at each historical spatiotemporal spatial location through dimensional transformation. The sigmoid classifier is used to transform the word embeddings of samples at each spatiotemporal location to obtain a set of labels describing whether each start position and each end position corresponds to the same answer text.

6. The knowledge graph and agent-driven spatiotemporal question answering method according to claim 5, characterized in that: The loss function model for the knowledge extraction model described in step 2 is defined as follows: in, This represents the loss function model of the knowledge extraction model. The loss function represents the correlation between historical spatiotemporal data samples. The loss function represents the correlation between historical spatiotemporal domain operator samples. The loss function represents the correlation between spatial location samples in the historical spatiotemporal domain; The loss function related to the historical spatiotemporal domain data samples is defined as follows: in, The number of historical spatiotemporal domain data samples input to the model. The result of calculating the first softmax classifier for the i-th input historical spatiotemporal domain data sample. The index of the starting token position in the description text of the manually annotated answer text for the i-th input historical spatiotemporal domain data sample. The result of calculating the second softmax classifier for the i-th input historical spatiotemporal domain data sample. This is the index of the end token position in the description text of the manually annotated answer text for the i-th input historical spatiotemporal domain data sample. The result of calculating the sigmoid classifier for the i-th input historical spatiotemporal domain data sample. It is a tag indicating whether the start token and end token of each answer text in the manually annotated descriptive text of the i-th input historical spatiotemporal domain data sample match or not; The loss function related to the historical spatiotemporal domain operator samples is defined as follows: in, The number of historical spatiotemporal domain operator samples input to the model. The result of calculating the first softmax classifier for the i-th input historical spatiotemporal domain operator sample. The index of the starting token position in the description text for the manually annotated answer text of the i-th input historical spatiotemporal domain operator sample. The result of calculating the second softmax classifier for the i-th input historical spatiotemporal domain operator sample. This is the index of the end token position in the description text of the manually annotated answer text for the i-th input historical spatiotemporal domain operator sample. The sigmoid classifier calculation result for the i-th input historical spatiotemporal domain operator sample. It is a label indicating whether the start token and end token of each answer text in the manually annotated descriptive text of the i-th input historical spatiotemporal domain operator sample match or not; The loss function related to the spatial location samples in the historical spatiotemporal domain is defined as follows: in, The number of historical spatiotemporal spatial location samples in the input model. The result of calculating the first softmax classifier for the i-th input historical spatiotemporal spatial location sample. The index of the starting token position in the description text for the manually annotated answer text of the i-th input historical spatiotemporal spatial location sample. The result of calculating the second softmax classifier for the i-th input historical spatiotemporal spatial location sample. The index of the end token position in the description text for the manually annotated answer text of the i-th input historical spatiotemporal spatial location sample. The sigmoid classifier calculation result for the i-th input historical spatiotemporal spatial location sample. It is a tag indicating whether the start token and end token of each answer text match in the manually annotated descriptive text of the i-th input historical spatiotemporal spatial location sample.

7. The knowledge graph and agent-driven spatiotemporal question answering method according to claim 6, characterized in that: Step 3 involves inputting the data into the trained knowledge extraction model to extract the answer text corresponding to each spatiotemporal domain sample, as detailed below: The samples of multiple spatiotemporal domain data, multiple spatiotemporal domain operators, and multiple spatiotemporal domain spatial locations are input into the trained knowledge extraction model. The start and end positions of each answer text corresponding to the samples of multiple spatiotemporal domain data, the samples of multiple spatiotemporal domain operators, and the samples of multiple spatiotemporal domain spatial locations are extracted. Then, based on the start and end positions of each answer text corresponding to each sample of spatiotemporal domain data, the samples of spatiotemporal domain operators, and the samples of spatiotemporal domain spatial locations, the text is concatenated to obtain each answer text corresponding to each sample of spatiotemporal domain data, each answer text corresponding to each sample of spatiotemporal domain operators, and each answer text corresponding to each sample of spatiotemporal domain spatial locations.

8. A knowledge graph and agent-driven spatiotemporal question-answering system, characterized in that, include: The sample label building module is used to build samples for each historical spatiotemporal domain data, samples for each historical spatiotemporal domain operator, and samples for each historical spatiotemporal domain spatial location, and to mark the start and end positions of the corresponding answer text in the description text; The knowledge extraction model training module is used to build a knowledge extraction model. It takes samples of each historical spatiotemporal domain data, samples of each historical spatiotemporal domain operator, and samples of each historical spatiotemporal domain spatial location as inputs to extract knowledge. It obtains the start and end positions of the answer text of each extracted question text in the description text, builds a knowledge extraction model loss function model, and optimizes the training through gradient descent to obtain the trained knowledge extraction model. The answer text extraction module is used to construct samples of each spatiotemporal domain data, each spatiotemporal domain operator, and each spatiotemporal domain spatial location by concatenating question texts. These samples are then input into the trained knowledge extraction model to extract the answer text corresponding to each spatiotemporal domain sample. The spatiotemporal knowledge graph construction module is used to combine spatiotemporal domain information to construct a spatiotemporal knowledge graph through knowledge relationships, and to transform each node of the spatiotemporal knowledge graph sequentially using a semantic embedding model to obtain the semantic feature vector of each node in the spatiotemporal knowledge graph; The preliminary search result calculation module is used to calculate the word vector of each keyword in the question statement entered by the user, and to select multiple user answer nodes in the spatiotemporal knowledge graph as preliminary search results by combining the cosine similarity ranking method. The final response determination module for the question statement is used to calculate the quantitative score of the preliminary search results in response to the user's input question statement. If the quantitative score is greater than the predefined score threshold, the user is prompted to provide further information through a dialog box. The information provided by the user is used to enhance the knowledge graph retrieval and further optimize the response. Otherwise, the preliminary search results, the results of the spatiotemporal domain operators, and the user's input question statement are input into the large language model for text integration to obtain the final response to the user's input question statement. In the answer text extraction module, samples for each spatiotemporal domain data, each spatiotemporal domain operator, and each spatiotemporal domain spatial location are constructed by concatenating the question text, as follows: By encapsulating API services for multiple spatiotemporal domain data and API services for multiple spatiotemporal domain operators, we can obtain the names and descriptions of multiple spatiotemporal domain data, multiple spatiotemporal domain operators, and multiple spatiotemporal domain spatial locations. The sample of each spatiotemporal domain data is obtained by concatenating multiple question texts of each spatiotemporal domain data with the description text of each spatiotemporal domain data. The sample of each spatiotemporal domain operator is obtained by concatenating multiple question texts of each spatiotemporal domain operator with the description text of each spatiotemporal domain operator. The sample of each spatiotemporal domain spatial location is obtained by concatenating multiple question texts of each spatiotemporal domain spatial location with the description text of each spatiotemporal domain spatial location. In the spatiotemporal knowledge graph construction module, the spatiotemporal domain information includes: The name of each spatiotemporal domain data obtained in the answer text extraction module is used as the name of each spatiotemporal domain data node, the name of each spatiotemporal domain operator is used as the name of each spatiotemporal domain operator node, the name of each spatiotemporal domain spatial location is used as the name of each spatiotemporal knowledge graph spatial location node, each question text corresponding to each spatiotemporal domain sample is used as the name of the question node of the spatiotemporal knowledge graph, and each answer text corresponding to each spatiotemporal domain sample is used as the name of the answer node of the spatiotemporal knowledge graph. In the spatiotemporal knowledge graph construction module, the construction of the spatiotemporal knowledge graph through knowledge relationships is specifically as follows: The spatiotemporal knowledge graph is composed of multiple nodes and the connections between nodes. The nodes in the spatiotemporal knowledge graph include five types: spatiotemporal domain data nodes, spatiotemporal domain operator nodes, spatiotemporal domain spatial location nodes, question nodes, and answer nodes. The knowledge relationships include 7 types, defined as follows: Any spatiotemporal spatial location node contains any spatiotemporal spatial location node; any spatiotemporal spatial location node is adjacent to any spatiotemporal spatial location node; any question node is related to any spatiotemporal data node; any question node is related to any spatiotemporal operator node; any question node is related to any spatiotemporal spatial location node; any answer node answers any question node; any spatiotemporal data node is related to any spatiotemporal spatial location node. In the preliminary search result calculation module, the word vector of each keyword in the user-input question statement is calculated based on the user-input question statement, as follows: The system extracts entities from the user-input question statement using a large language model, obtaining multiple keywords from the user-input question statement. Then, it uses a semantic embedding model to calculate the word vector of each keyword in the user-input question statement. In the preliminary search result calculation module, the method of combining cosine similarity ranking to select multiple user response nodes in the spatiotemporal knowledge graph as preliminary search results is as follows: Calculate the cosine similarity between the word vector of each keyword in the user's input question and the semantic feature vector of all nodes in the spatiotemporal knowledge graph. Sort the nodes according to the cosine similarity from high to low and select the top K nodes with the highest cosine similarity. By obtaining all first-order neighbor nodes of each node with the highest similarity through the relationship between nodes in the spatiotemporal knowledge graph, the K nodes with the highest similarity and all first-order neighbor nodes of the K nodes with the highest similarity are defined as user response nodes, and all attribute information of multiple user response nodes is defined as preliminary search results. In the final response determination module for the question statement, the final response determination for the user-input question statement is calculated by combining the quantitative score of the user-input question statement, as follows: The user's input question and preliminary search results are fed into the large language model for calculation, and a quantitative score is obtained for the preliminary search results in response to the user's input question. Calculate the quantitative score of the initial search results in response to the user's input question. If the quantitative score is greater than the predefined score threshold, proceed to step 6.1; otherwise, proceed to step 6.

2. Step 6.1: Prompt the user to provide further feedback through a dialog box, and enhance the knowledge graph retrieval based on the user's feedback to further optimize the response; Step 6.2: Input the preliminary search results, the results of the spatiotemporal domain operator execution, and the user's input question into the large language model for text integration to obtain the final response to the user's input question; The result of the spatiotemporal domain operator execution described in step 6.2 is calculated as follows: Based on the operator nodes contained in the preliminary search results and the question statement entered by the user, an agent based on a large language model is invoked to recall relevant spatiotemporal domain operator APIs and relevant spatiotemporal domain data APIs in the spatiotemporal domain knowledge graph. The agent is then used to construct an HTTP request to invoke the spatiotemporal domain data API and spatiotemporal domain operator API to complete the processing of relevant spatiotemporal domain data by the spatiotemporal domain operators, thereby obtaining the results of the spatiotemporal domain operator execution.

Citation Information

Patent Citations

  • Space-time artificial intelligence expert system and robot based on knowledge graph and big data

    CN114282004A

  • Knowledge graph visual question and answer method based on double-process cognitive theory

    CN115186072A