Search enhancement method, medium and device fusing spatiotemporal indexes

By constructing an index key and using adaptive spatiotemporal retrieval technology, the problems of insufficient timeliness and accuracy of retrieval results in existing technologies have been solved, achieving efficient and accurate information retrieval.

CN121117128BActive Publication Date: 2026-02-27HUNAN AGRI UNIV +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511631965.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-10
Publication Date
2026-02-27
Estimated Expiration
2045-11-10

AI Technical Summary

Technical Problem

Existing RAG technology cannot accurately reflect the dynamic process of event development when handling time-sensitive or geographically related tasks, resulting in time-related noise in the search results. Furthermore, spatiotemporal retrieval technology may reduce search efficiency and accuracy when the query is not precise.

Method used

By extracting time slices and geographical slices from the original documents, constructing index keys, determining spatiotemporal confidence, adaptively selecting spatiotemporal retrieval techniques, performing initial screening and semantic retrieval, and obtaining the final query results.

Benefits of technology

It improves the efficiency and accuracy of retrieval, avoids the waste of computing resources, and ensures the timeliness and accuracy of retrieval results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121117128B_ABST
    Figure CN121117128B_ABST
Patent Text Reader

Abstract

The application relates to a retrieval enhancement method, medium and equipment fusing space-time indexes, which comprises the following steps: extracting time slices and geographical slices in original documents to construct an index table comprising several index keys; extracting time slices, geographical slices, keywords and space-time confidence in a query question, performing intention modeling and structured output on the query question to obtain an updated query question; judging whether the space-time confidence exceeds a set confidence threshold, if yes, performing space-time retrieval on the index table according to the time slices and geographical slices of the query question to preliminarily screen a plurality of candidate document segments; and performing semantic retrieval on the candidate document segments according to the updated query question to obtain a final query result. The application solves the problem that the prior art cannot adaptively select whether to use space-time retrieval technology according to a query question to improve retrieval efficiency and precision.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of information retrieval, in particular to a retrieval enhancement method fusing spatio-temporal index, medium and equipment. BACKGROUND

[0002] In the field of artificial intelligence, the retrieval-augmented generation (RAG) method based on large models has broad application prospects in question and answer systems, knowledge reasoning and document generation, etc. However, the existing RAG technology still faces significant challenges when dealing with time-sensitive or geographically related tasks.

[0003] In the field of traditional technology, the traditional retrieval engine only performs simple word segmentation or dependency syntax analysis on the query statement, and cannot filter according to time information and geographical information, resulting in the fact that the evolution characteristics of knowledge in the time dimension are ignored during retrieval, and the dynamic process of event development cannot be accurately reflected, so that there are many noises in the retrieval results that do not have timeliness. This change process fully illustrates that the value and context of information carried in different periods have significant differences. On the other hand, the knowledge in many scenarios also presents strong geographical dependence, such as the outbreak of agricultural pests and diseases often has obvious regional characteristics, and the influence range of environmental pollution events is also limited by geographical distribution, but the traditional retrieval engine does not consider preliminary screening according to geographical information to improve retrieval efficiency.

[0004] Therefore, some technologies that introduce spatio-temporal retrieval have gradually emerged to improve retrieval accuracy. For example, the Chinese application with publication number CN116775722 A discloses a "spatio-temporal retrieval method, device, equipment and medium based on multi-element data fusion". However, the existing spatio-temporal retrieval technology usually adopts a deterministic processing of "0 or 1" for the time and geographical description in the query, and if the spatio-temporal attributes of the query problem are not strong and accurate, the introduction of spatio-temporal retrieval may lead to problems such as reduced retrieval efficiency and insufficient accuracy.

[0005] Therefore, how to adaptively select whether to use spatio-temporal retrieval technology according to the query problem to improve retrieval efficiency and accuracy is a technical problem that needs to be solved in this field. SUMMARY

[0006] Based on this, the present application aims to provide a retrieval enhancement method fusing spatio-temporal index, medium and equipment to solve at least one technical problem mentioned in the background technology.

[0007] In a first aspect, the present application provides a retrieval enhancement method fusing spatio-temporal index, comprising:

[0008] S1: extract time slices and geographic slices in the original document, construct index keys of each original document, and obtain an index table including a plurality of index keys; the index keys include: a document segment identifier and a time slice and a geographic slice mapped with the document segment identifier;

[0009] S2: extract metadata in the query question, model the intention of the query question, and structure the output to obtain an updated query question; the metadata includes: time slice, geographic slice, keyword, and spatiotemporal confidence;

[0010] S3: determine whether the spatiotemporal confidence exceeds a set confidence threshold, and if so:

[0011] S4: perform spatiotemporal retrieval on the index table according to the time slice and the geographic slice of the query question, and preliminarily screen a plurality of index keys, and obtain corresponding original document segments as candidate document segments;

[0012] S5: perform semantic retrieval on each candidate document segment according to the updated query question to obtain a final query result.

[0013] Further, the step of extracting the time slice of the original document includes:

[0014] extracting time entities and domain scenarios of the original document;

[0015] performing format conversion on the time entities according to a standardized template to obtain a standard time slice;

[0016] determining a domain-specific template according to the domain scenario; the domain-specific template includes a time granularity and a domain standard format; determining a time range in which the time entity is located according to the time granularity, and performing format conversion on the time range according to the standardized format to obtain a domain time slice;

[0017] splicing the standard time slice and the domain time slice to obtain a finally determined time slice.

[0018] Further, the step of extracting the geographic slice of the original document includes:

[0019] extracting all geographic description words in the original document, and counting the occurrence frequency of each geographic description word, and taking the geographic description word with the highest occurrence frequency as a geographic entity;

[0020] obtaining a coverage range of the geographic entity, and determining whether the coverage range is greater than a set range threshold;

[0021] if yes, encoding the geographic entity according to a region tree; if no, encoding the geographic entity according to latitude and longitude; and obtaining a geographic slice of the geographic entity.

[0022] Further, the step of extracting metadata in the query question, modeling the intention of the query question, and structuring the output to obtain an updated query question includes:

[0023] constructing and training a spatio-temporal entity recognition model taking a query question as input and time entity and geographic entity as output;

[0024] inputting the query question into the trained spatio-temporal entity recognition model to obtain the time entity and the geographic entity;

[0025] standardizing the time entity and the geographic entity to obtain a time slice and a geographic slice;

[0026] splitting the query question into a plurality of words, calculating a TF-IDF value of each word, sorting the words according to the TF-IDF values, and sequentially selecting a plurality of words as keywords;

[0027] inputting the query question into a spatio-temporal intent classifier to obtain a spatio-temporal confidence of the query question.

[0028] Further, before standardizing the time entity and the geographic entity, the steps further comprise:

[0029] determining whether the time entity is a fuzzy time entity, if not, leaving it unchanged, if yes, then:

[0030] obtaining a time entity adjacent to the fuzzy time entity as a reference time;

[0031] obtaining a clear time range as an optimized time entity according to the reference time, the fuzzy time entity and prior matching logic;

[0032] Or / and: determining whether the geographic entity is a fuzzy geographic entity, if not, leaving it unchanged, if yes, then:

[0033] obtaining a geographic entity adjacent to the fuzzy geographic entity as a reference location;

[0034] obtaining a clear geographic location as an optimized geographic entity according to the reference location, the fuzzy geographic entity and prior analysis logic.

[0035] Further, according to the updated query question, the steps of performing semantic retrieval on the candidate document segments to obtain the final query result comprise:

[0036] obtaining a vector similarity and a keyword matching degree between the query question and each candidate document;

[0037] determining a total similarity between the query question and each candidate document according to the spatio-temporal confidence, the vector similarity and the keyword matching degree;

[0038] sorting the candidate document segments according to the total similarity, and sequentially selecting a plurality of candidate document segments as the final query result.

[0039] Further, the step of determining the total similarity between the query question and each candidate document according to the spatio-temporal confidence, the vector similarity and the keyword matching degree comprises:

[0040] According to the spatio-temporal confidence, the literal anchor weight and the spatio-temporal confidence weight are determined.

[0041] The product of the literal anchor weight and the keyword matching degree is obtained to obtain the literal relevance degree.

[0042] The product of the spatio-temporal confidence weight and the vector similarity is obtained to obtain the semantic similarity.

[0043] The sum of the literal relevance degree and the semantic similarity is obtained to obtain the total similarity between the query question and each candidate document.

[0044] Further, the step of ranking each candidate document segment according to the total similarity and sequentially selecting a plurality of candidate document segments as the final determined query result comprises:

[0045] It is judged whether the number of document segments in the final determined query result is not less than a number threshold, if yes, the final query result is obtained, and if no, the following steps are performed:

[0046] The time granularity and the geographic granularity of the query question are obtained, and the time expansion threshold and the geographic expansion threshold are dynamically determined.

[0047] The time slice and the geographic slice of the query question are updated according to the time expansion threshold and the geographic expansion threshold, and the step S4 is returned.

[0048] In a second aspect, the application further provides a computer storage medium storing executable program codes; the executable program codes are used to execute the retrieval enhancement method of the fused spatio-temporal index according to any one of the first aspect.

[0049] In a third aspect, the application further provides a terminal device comprising a memory and a processor; the memory stores program codes executable by the processor; the program codes are used to execute the retrieval enhancement method of the fused spatio-temporal index according to any one of the first aspect.

[0050] The application provides a retrieval enhancement method, medium and device fusing space-time indexes, which extracts time slices and geographic slices in original documents, constructs index keys of each original document, and obtains an index table including a plurality of index keys; each index key includes a document section identifier and a time slice and a geographic slice mapped with the document section identifier; so that any subsequent query can be directly positioned to the most relevant document section as long as the time and geographic range is given, full-text scanning is avoided, and the consumption of computing resources is significantly reduced; metadata in the query question is extracted, the query question is intention modeled and structured output, and an updated query question is obtained; the metadata includes time slices, geographic slices, keywords and space-time confidence; the fuzzy natural language question is converted into four structured metadata of time slices, geographic slices, keywords and space-time confidence, and the retrieval boundary is determined, so that it is firstly judged whether the space-time confidence exceeds a set confidence threshold, if not, the space-time confidence of the query question is low, and a traditional keyword / vector retrieval method such as traditional retrieval method is directly used, so that the missed detection caused by space-time filtering is avoided; if yes, the space-time confidence is high, and the retrieval enhancement method fusing space-time indexes is used, the efficiency and effect are considered, when the retrieval enhancement method fusing space-time indexes is determined to be used, the index table is subjected to space-time retrieval according to the time slices and the geographic slices of the query question, a plurality of index keys are obtained by preliminary screening, and corresponding original documents are obtained as candidate document sections; through the double filtering of time and geography, noise not meeting the requirements is quickly and accurately filtered, the computing resources are reduced, and the efficiency of the subsequent step is improved, then the candidate document sections are subjected to semantic retrieval according to the updated query question, and the final query result is obtained, the semantic similarity between the query question and each candidate document section is obtained, the second screening is performed, and the retrieval accuracy is further improved. The problems that the prior art cannot adaptively select whether to use space-time retrieval technology according to the query question to improve the retrieval efficiency and precision are solved. BRIEF DESCRIPTION OF DRAWINGS

[0051] Figure 1 A flowchart of the retrieval enhancement method fusing space-time indexes of the embodiments of the application. DETAILED DESCRIPTION

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

[0053] It should be noted that if the embodiments of the present application involve directional indications, such as up, down, left, right, front, back, etc., the directional indications are only used to explain the relative position relationship between the components, the movement condition, etc. in a certain posture, and if the certain posture changes, the directional indications will also change accordingly. In addition, if the embodiments of the present application involve descriptions such as "first, second", "S1, S2", "step one, step two" and the like, such descriptions are only for description purposes, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of technical features indicated or indicating the execution order of the method, etc. Those skilled in the art can understand that any change within the technical concept of the invention without deviating from the invention points should be included in the protection scope of the present application.

[0054] As shown in Figure 1 The present application provides a retrieval enhancement method based on spatio-temporal index fusion:

[0055] S1: Extracting time slices and geographic slices in the original document, constructing index keys of each original document, and obtaining an index table including a plurality of index keys; the index key includes: a document segment identifier and a time slice and a geographic slice mapped with the document segment identifier;

[0056] Specifically, a plurality of original documents can be obtained from any existing database, and each original document can be configured with a unique document segment identifier. Since in a large number of actual documents, especially in unstructured texts in vertical fields such as agriculture, meteorology, and medical treatment, most of the high-relevance text segments only contain 1-2 time expressions and one main geographic location, which have the characteristics of context concentration and clear information focus, the original document can be input into an existing natural language processing tool to directly extract time entities and geographic entities in the original document, and the time slices and geographic slices can be obtained after standardization. Then, the time slices and geographic slices are combined with the previously set document segment identifier to obtain the index keys corresponding to each original document, so as to construct an index table according to the index keys, and provide a data basis for the subsequent retrieval step; the original document can include any public literature such as government reports, news articles, research papers, etc.

[0057] Preferably, the step of extracting the time slice in the original document comprises:

[0058] S11: Extracting time entities and field scenarios of the original document;

[0059] Specifically, but not limited to, a plurality of field scenarios are preset, and then the original document is input into any existing natural language processing tool to extract all time-related descriptors in the original document to obtain time entities, and the original document is matched with each field scenario to obtain the field scenario with the highest matching degree as the field scenario corresponding to the original document. Natural language processing tools can include commonly used tools such as BERT-NER, LAC, or SpaCy. Field scenarios can include the agricultural field, the medical field, the economic field, and the like.

[0060] Preferably, since there are usually more than one time descriptor in each original document, but only one combination of time and geography is needed when constructing the index key. If there are multiple different times or geographic information in the index key, it may increase a lot of noise in the user's retrieval process, so the time descriptors in the original document need to be screened to obtain the time descriptor most related to the content of the original document as the time entity of the original document. Since the first time descriptor in each original document often appears at the beginning of the text, it naturally has the summarizing power of "title", so the first time descriptor can be extracted as the time entity of the original document to avoid ambiguity caused by subsequent same type words.

[0061] For example, the time entity includes a time point (such as "March 2023"), an event stage (such as "before and after summer harvest"), and any phrase or word containing time description.

[0062] Preferably, since there is a probability of a fuzzy time entity in the original document, i.e., a time entity that cannot determine the accurate time point or time range by itself, a pre-trained model can be used to identify it to obtain an optimized time entity.

[0063] S12: Format conversion of the time entity according to the standardized template to obtain a standard time slice;

[0064] Specifically, but not limited to, a standardized template is set, and the time entity is format-converted according to the standardized template to obtain a standard time slice.

[0065] Preferably, the standardized template can adopt the ISO 8601 international standard format.

[0066] For example, "March 25, 2023, 3 pm" → 2023-04-25T15:00:00.

[0067] S13: Determine the field-specific template according to the field scenario; the field-specific template includes a time granularity and a standardized format; determine the time range in which the time entity is located according to the time granularity, and format-convert the time range according to the standardized format to obtain a field time slice;

[0068] Specifically, since the user generally inputs professional terms in the field according to habits when querying related information, such as "Shun" or "Solar Term" in the agricultural field, "transaction week", "financial quarter" or "financial year" in the financial field, the minimum time granularity and standardized templates of each field scene can be determined, and the field-specific templates of each field scene are obtained, so that the user can quickly locate the original document related to the field when using the term for retrieval, thereby improving the retrieval efficiency and accuracy.

[0069] Specifically, taking the agricultural scene as an example, since the key nodes such as heading, filling, and maturity of crops are highly bound to meteorological factors such as ≥10℃ accumulated temperature and sunshine length, and solar term (15 days per term) is exactly the average period of the conversion of cold, warm, dry and wet in the East Asian monsoon region. Shun (10 days) is similar to the effective accumulated temperature required for most pests to complete one generation (egg-larva-pupa-adult), and one field artificial investigation needs "get off the ground-sample-microscope", the transportation and labor costs are much higher than the automatic recording of instruments. If the granularity is shortened to "day", the marginal information increment cannot offset the cost increment, therefore, the "Shun" or "solar term" can be selected as the basic time granularity to standardize the time entity. For example, "2023 April 25 pm 3 o'clock" → 2023 April late → 2023M04_D3.

[0070] Taking the financial field as an example, unlike the agricultural field, weather has little effect on financial activities, and financial activities mainly follow rules set by humans, such as transaction week, financial quarter, and financial year, therefore, the year, month, and day can be selected as the basic time granularity to standardize the time entity. For example, "2023 April 25 pm 3 o'clock" → 2023 April 25 → FY2023Q2M04D25.

[0071] Taking the medical field as an example, since some symptoms occur very quickly, the basic time granularity can be accurately to "hour" to standardize the time entity. For example, "2023 April 25 pm 3 o'clock" → 2023M04D25T15:00.

[0072] S14: Splice the standard time slice and the field time slice to obtain the finally determined time slice.

[0073] Specifically, taking the time "2023 April 25 pm 3 o'clock" as an example, when the original document corresponds to the field scene of the agricultural field, the standard time slice is 2023-04-25T15: 00: 00, the field time slice is 2023M04_D3, and the final determined time slice is 2023-04-25T15: 00: 00#2023M04_D3, wherein # is a separator, which is only an example but is not limited to this, when a technician in a certain field retrieves problems in other fields, the most commonly used is the ISO 8601 international standard format in daily life, that is, the format of year, month, day and hour, so that the final determined time slice contains the standard time slice, so that technicians in any field can retrieve the desired retrieval result according to the general format, and technicians in the technical field are usually used to using professional terms in the technical field, such as "decade" in the agricultural field and "financial year" in the financial field, so that the final determined time slice also contains the field time slice, so that the technicians in the technical field can quickly locate the technical documents in the technical field when using the professional terms in the field, and improve the retrieval efficiency and accuracy.

[0074] Preferably, the step of extracting the geographic slice in the original document comprises:

[0075] S15: Extract all geographic description words in the original document, and count the occurrence frequency of each geographic description word, and take the geographic description word with the highest occurrence frequency as the geographic entity;

[0076] Specifically, as described in step S11, all extracted geographic description words need to be screened to obtain unique geographic description words as geographic entities, so as to reduce noise in the user retrieval process, therefore, the occurrence frequency of all geographic description words can be optionally counted, since high frequency means that the place is mentioned in the context, that is, the space consensus that best represents the original document, therefore, the geographic phrase with the highest occurrence frequency can be optionally taken as the geographic entity, so as to filter out the noise caused by occasional or secondary place names.

[0077] For example, the geographic entity includes administrative division (such as "Kaifeng, Henan") and geographic position (such as "Kaifeng, Henan Province", "Yellow River and Huaihe River Plain", "North China") and any phrase or word containing geographic description.

[0078] S16: Obtain the coverage range of the geographic entity, and judge whether the coverage range is greater than the set range threshold;

[0079] S17: If yes, encode the geographic entity according to the region tree; if no, encode the geographic entity according to the latitude and longitude; obtain the geographic slice of the geographic entity.

[0080] Specifically, but not limited to, set the range threshold, and according to the land survey data or map data or any existing database to obtain the coverage of geographical entities, to determine whether the coverage is greater than the set range threshold, if so, it means that the coverage of the geographical entity is larger, because the latitude and longitude coding needs to cut the entire earth surface into several grids, which is similar to a rectangle, but the boundary of the geographical entity is mostly polygon, when the coverage of the geographical entity is larger, the error is larger when cutting, and the region tree node itself is a polygon, the error is smaller, therefore, it is preferred to encode the geographical entity with the region tree to obtain the geographical piece of the geographical entity, if not, it means that the coverage of the geographical entity is smaller, when using latitude and longitude coding, only a few characters are needed to locate the corresponding geographical entity, when using region tree coding, the increase of the hierarchical structure leads to the result of the geographical piece obtained by coding being too long.

[0081] Examples, taking the Yangtze River trunk and a certain village in Yuhua District of Changsha City in Hunan Province as an example, when using region tree to encode the Yangtze River trunk, the water system code of the national environmental system can be selected for coding, and the region tree coding of the Yangtze River trunk is FA029, when using latitude and longitude to encode the Yangtze River trunk, GeoHash coding can be selected, and the latitude and longitude coding of the Yangtze River trunk is wm6nkr2j, at this time, the geographical piece obtained by region tree coding is not only more concise than the geographical piece obtained by latitude and longitude coding, but also because the latitude and longitude coding represents the grid-shaped area where the geographical entity is located, therefore, the more tortuous the shape of the Yangtze River trunk is, the larger the error of latitude and longitude coding is, so when the geographical entity is larger, region tree coding is preferred; when using region tree to encode a certain village in Yuhua District of Changsha City in Hunan Province, the administrative code and urban-rural division code of the village can be selected to obtain the region tree coding of the village, which is 430111102205, when using latitude and longitude to encode the village, GeoHash coding can be selected, and the latitude and longitude coding of the village is ws6epc6h, when the geographical entity is smaller, the result obtained by latitude and longitude coding is more concise than the result obtained by region tree coding, and because the geographical entity is smaller, the error of latitude and longitude coding is also smaller, so when the geographical entity is smaller, latitude and longitude coding is preferred.

[0082] Examples, the time entities and geographical entities in the original document can be extracted by the following code:

[0083] def extract_temporal_spatial_entities(document):

[0084] time_entities = NER(document, type="TIME")

[0085] location_entities = NER(document, type="LOCATION")

[0086] return time_entities, location_entities

[0087] The output format examples are: ["Spring 2022"], ["Kaifeng City, Henan Province"]

[0088] It should be noted that the code used in this application is only an example implementation, but it is not limited to this.

[0089] For example, optionally, the following code can also be used to extract time entities and geographical entities from the original document:

[0090] SCENE_TIME_GRANULARITY = {

[0091] "agriculture": ["Solar terms", "Ten-day period", "Month"],

[0092] "finance": ["Quarter", "Month"],

[0093] "meteorology": ["Ten-day period", "Day"],

[0094] "general": ["Year", "Month"]

[0095] }

[0096] def extract_time_entities(text, scene="general", context_time=None):

[0097] entities = []

[0098] # 1. Rule matching for standard time

[0099] entities += match_time_by_regex(text)

[0100] # 2. Using a pre-trained model to identify fuzzy time expressions

[0101] entities += ner_model.predict_time_spans(text)

[0102] # 3. Supplementing domain-specific time units (such as solar terms)

[0103] if scene == "agriculture":

[0104] entities += match_agricultural_terms(text)

[0105] return deduplicate(entities)

[0106] def normalize_time_entity(entity, scene="general", context_time=None):

[0107] for g in SCENE_TIME_GRANULARITY.get(scene, ["month"]):

[0108] if match_format(entity, g):

[0109] return to_standard_code(entity, g)

[0110] if is_fuzzy(entity):

[0111] inferred = infer_from_context(entity, context_time)

[0112] return normalize_time_entity(inferred, scene, context_time)

[0113] return to_date_format(entity)

[0114] This embodiment presents a novel method for extracting time slices and geographic slices. Regarding time slices, during the extraction of original document information, not only are the time entities extracted, but also their domain context. On one hand, time entities are converted into standard time slices based on a standardized template; on the other hand, combined with the domain context, time entities are converted into domain-specific time slices based on a domain-specific template. A time slice combining standard and domain time slices is constructed. Regarding geographic slices, different encoding methods are used based on the coverage of geographic entities to obtain geographic slices. This improves the efficiency and accuracy of subsequent spatiotemporal retrieval.

[0115] S2: extract the metadata in the query question, model the intention of the query question and structure the output, and obtain an updated query question; the metadata includes: time slice, geographic slice, keyword and spatio-temporal confidence;

[0116] Specifically, since the description of time information and geographic information in the query question input by the user is different, a pre-existing lightweight pre-training spatio-temporal entity recognition model can be selected to extract the time entity and the geographic entity in the query question, and the corresponding time slice and geographic slice are obtained by standardizing the time entity and the geographic entity according to step S1. Then, the spatio-temporal confidence of the query question is obtained by using a prior spatio-temporal intention classifier, and the keywords in the query question are extracted by calling a prior keyword extraction function.

[0117] S21: constructing and training a spatio-temporal entity recognition model taking the query question as input and the time entity and the geographic entity as output;

[0118] Specifically, but not limited to, a plurality of pre-stored query questions are obtained, and the time entity and the geographic entity in the query question are labeled to obtain a training data set; the spatio-temporal entity recognition model can use any neural network model in the prior art; the training data set is constructed based on the above-mentioned plurality of labeled query questions; then, the initial neural network model is input according to the training data set, so as to train the parameters of the initial neural network model, and obtain the trained neural network model as the spatio-temporal entity recognition model. It is worth noting that this step is a preparation work, which can be constructed and trained in advance, and only needs to be constructed and trained before using the spatio-temporal entity recognition model for analysis.

[0119] S22: inputting the query question into the trained spatio-temporal entity recognition model to obtain the time entity and the geographic entity;

[0120] S23: standardizing the time entity and the geographic entity to obtain the time slice and the geographic slice;

[0121] Specifically, but not limited to, the query question input by the user is input into the trained spatio-temporal entity recognition model to obtain the time entity and the geographic entity in the query question, and then the time entity and the geographic entity are standardized according to step S1 to obtain the time slice and the geographic slice, so as to facilitate the preliminary retrieval of the index table according to the standardized time slice and the geographic slice.

[0122] Preferably, since the time entity and the geographic entity in the query question input by the user can be relatively vague, such as the existence of "recent", "last year", "local" and "peripheral" and other relatively or vague time entity and geographic entity, the subsequent steps cannot retrieve the index table according to such time entity or geographic entity, therefore, before standardizing the time entity and the geographic entity, the step further comprises:

[0123] S221: Determine whether there is a time entity that is a fuzzy time entity. If not, do nothing. If yes, then:

[0124] S222: Obtain a time entity adjacent to the fuzzy time entity as a reference time.

[0125] S223: Obtain a clear time range as an optimized time entity according to the reference time, the fuzzy time entity, and prior matching logic.

[0126] Specifically, each time entity can be optionally determined in sequence whether it is a fuzzy time entity, i.e., a time entity that cannot determine an accurate time point or time range by itself. If there is a fuzzy time entity, a reference time adjacent to the fuzzy time entity can be optionally obtained according to the context, and a clear time range as an optimized time entity can be obtained according to the reference time, the fuzzy time entity, and prior matching logic. Examples of the fuzzy time entity, the prior matching logic, and the inference result are optionally shown in Table 1:

[0127] Table 1: Fuzzy time entity normalization table

[0128]

[0129] Or / and: S224: Determine whether there is a geographic entity that is a fuzzy geographic entity. If not, do nothing. If yes, then:

[0130] S225: Obtain a geographic entity adjacent to the fuzzy geographic entity as a reference location.

[0131] S226: Obtain a clear geographic position as an optimized geographic entity according to the reference location, the fuzzy geographic entity, and prior analysis logic.

[0132] Specifically, each geographic entity can be optionally determined in sequence whether it is a fuzzy geographic entity, i.e., a geographic entity that cannot determine an accurate location or geographic range by itself. If there is a fuzzy geographic entity, a reference location adjacent to the fuzzy geographic entity can be optionally obtained according to the context, and a clear geographic position as an optimized geographic entity can be obtained according to the reference location, the fuzzy geographic entity, and prior analysis logic. Examples of the fuzzy geographic entity, the prior analysis logic, and the inference result are optionally shown in Table 2:

[0133] Table 2: Fuzzy geographic entity normalization table

[0134]

[0135] Examples of the steps of standardizing the geographic entity can be optionally implemented by the following code:

[0136] from datetime import datetime, timedelta

[0137] from dateutil.relativedelta import relativedelta

[0138] def parse_fuzzy_time(expression, context_date):

[0139] base = datetime.strptime(context_date, "%Y-%m-%d")

[0140] if expression == "last year":

[0141] return base.replace(year=base.year - 1, month=1, day=1), \

[0142] base.replace(year=base.year - 1, month=12, day=31)

[0143] elif expression == "the past five years":

[0144] return base.replace(year=base.year - 4, month=1, day=1), \

[0145] base.replace(month=12, day=31)

[0146] elif "the beginning of last month" in expression:

[0147] last_month = base - relativedelta(months=1)

[0148] return last_month.replace(day=1), last_month.replace(day=10)

[0149] elif expression == "around the Spring Festival":

[0150] chunjie = get_chinese_new_year(base.year)

[0151] return chunjie - timedelta(days=7), chunjie + timedelta(days=7)

[0152] elif expression in ["recently", "in recent times"]:

[0153] return base - timedelta(days=30), base

[0154] else:

[0155] return infer_time_from_llm(expression, base)

[0156] def resolve_location(expression, base_location):

[0157] if expression in ["local", "this region"]:

[0158] return get_adcode(base_location)

[0159] elif expression == "surroundings":

[0160] return get_nearby_adcodes(base_location, radius_km=200)

[0161] elif "central and northern" in expression:

[0162] return region_split_lookup(base_location, expression)

[0163] elif expression in ["East China", "North China", "Southwest China"]:

[0164] return match_national_macro_regions(expression)

[0165] else:

[0166] return infer_location_from_llm(expression, base_location)

[0167] def normalize_time_location(times, locations, context_time, context_loc):

[0168] norm_time = [parse_fuzzy_time(t, context_time) for t in times]

[0169] norm_loc = [resolve_location(l, context_loc) for l in locations]

[0170] return norm_time, norm_loc

[0171] S24: Split the query question into several words, calculate the TF-IDF value of each word, sort the words according to the TF-IDF value, and sequentially select several words as keywords.

[0172] Specifically, but not limited to, the query question is split into several words, and the TF-IDF value of each word is calculated, the words are sorted according to the TF-IDF value, and several words are sequentially selected as keywords according to the importance of each word.

[0173] Preferably, the query question is input into the prior extract_keywords() function to extract the keywords of the current query question.

[0174] S25: Input the query question into the spatio-temporal intent classifier to obtain the spatio-temporal confidence of the query question.

[0175] Specifically, since not all query questions have spatio-temporal attributes, it is necessary to rely on spatio-temporal retrieval enhancement. When the user input query question does not have spatio-temporal attributes, the retrieval enhancement method of fusing spatio-temporal indexes will instead reduce retrieval efficiency. Therefore, before using the method to retrieve query questions, the spatio-temporal confidence of the query question needs to be obtained to determine whether the query question has clear spatio-temporal attributes and further quantify its "spatio-temporal dependence strength" to determine whether to use the retrieval enhancement method of fusing spatio-temporal indexes to retrieve it. Therefore, a spatio-temporal intent classifier that takes query questions as input and spatio-temporal confidence as output can be constructed and trained, and then the current user input query question is input into the trained spatio-temporal intent classifier to obtain the spatio-temporal confidence of the current query question. Preferably, the spatio-temporal intent classifier can optionally use the BERT fine-tune model.

[0176] Examples, the spatio-temporal confidence of the query question can be obtained by the following code:

[0177] def classify_temporal_spatial_intent(query):

[0178] model_input = tokenize(query)

[0179] intent_score = intent_classifier.predict(model_input) # output like: {“spatial”:0.85, “temporal”:0.76}

[0180] if intent_score["spatial"]> 0.5 or intent_score["temporal"]>0.5:

[0181] return True, intent_score

[0182] return False, intent_score

[0183] Examples:

[0184] Query: “What regions have broken out after 2021 African swine fever?” → Strong spatio-temporal intent;

[0185] Query: “How is swine fever transmitted?” → General knowledge intent, weak spatio-temporal dependence.

[0186] S3: Determine whether the spatio-temporal confidence exceeds the set confidence threshold. If so, perform step S4;

[0187] Specifically, but not limited to, setting a confidence threshold, the spatio-temporal confidence of the current query question is obtained according to step S24, and it is judged whether it is greater than the confidence threshold. If not, it means that the current query question does not have a spatio-temporal attribute or the spatio-temporal attribute is weak, and using the retrieval enhancement method of fusion spatio-temporal index will reduce the retrieval efficiency, and any traditional retrieval method should be used. If yes, it means that the current query question has strong spatio-temporal attribute, and the retrieval enhancement method of fusion spatio-temporal index can be used for retrieval to improve the retrieval efficiency and accuracy.

[0188] When the spatio-temporal confidence of the query question is higher than the confidence threshold, the step further comprises:

[0189] S4: According to the time slice and the geographic slice of the query question, the index table is spatio-temporally searched, and a plurality of index keys are obtained by preliminary screening, and a plurality of candidate document segments corresponding to the original documents are obtained;

[0190] Specifically, but not limited to, according to the time slice and the geographic slice of the query question, the index table is spatio-temporally searched, a plurality of index keys corresponding to the time slice and the geographic slice of the query question are obtained, the preliminary screening step is completed through spatio-temporal information, the search range is reduced, and the retrieval efficiency and accuracy are improved, and then a plurality of candidate document segments are obtained by extracting the original documents corresponding to the index keys.

[0191] For example, when the time slice of the query question is 2023M04_D3 and the geographic slice is CN.37, all index keys containing 2023M04_D3 and CN.37 in the index table are extracted, thereby obtaining a plurality of original documents corresponding to the time slice and the geographic slice of the query question as candidate document segments.

[0192] S5: According to the updated query question, the semantic retrieval of each candidate document segment is performed to obtain the final query result.

[0193] Specifically, but not limited to, according to the updated query question, the semantic retrieval of each candidate document segment obtained in step S4 is performed, the similarity between the updated query question and each candidate document segment is obtained, then each candidate document segment is sorted according to the similarity, the higher the similarity, the higher the relevance between the candidate document segment and the query question, and the closer to the answer the user wants to retrieve, then a plurality of candidate document segments are selected in order, and the final query result is obtained.

[0194] Preferably, the semantic retrieval includes vector retrieval and keyword retrieval; the step of performing semantic retrieval on each candidate document segment comprises:

[0195] S51: Obtain the vector similarity and the keyword matching degree of the query question and each candidate document;

[0196] Specifically, optional but not limited to converting the query question and each candidate document into vector form using any existing model, obtaining a query vector and several document vectors, and calculating the similarity between the query vector and each document vector, such as cosine similarity, to obtain vector similarity.

[0197] Then, the keywords of the query question and the keywords of each candidate document are obtained to calculate the keyword matching degree between the query question and each candidate document. Optional, but not limited to, obtaining the keywords of the query question and the keywords of each candidate document according to step S25, and calculating the keyword matching degree between the query question and each candidate document according to the calc_keyword_match function. First, explicit word matching is captured through keyword matching degree to recall literally highly related but semantically simple fragments. Then, deep semantics are captured through vector similarity to compensate for literal differences caused by synonyms, near-synonyms, and sentence structure variations. By comprehensively considering the similarity between the query question and each candidate document segment through multiple dimensions, the shortcomings of a single-dimensional evaluation perspective are avoided, thereby improving the judgment accuracy and balancing the judgment accuracy and recall rate.

[0198] S52: Determine the total similarity between the query question and each candidate document based on spatiotemporal confidence, vector similarity, and keyword matching degree.

[0199] Specifically, based on spatiotemporal confidence, the weights of vector similarity and keyword matching can be set. The vector similarity and keyword matching are then weighted and summed according to the set weights to obtain the total similarity between the query question and each candidate document. In this way, the keyword matching and vector similarity are complemented and fused by setting weights, taking into account multiple dimensions such as overlapping words and synonyms, so as to improve the overall search effect.

[0200] For example, the following code can be used to obtain the keyword matching degree and vector similarity between the query question and each candidate document, and then perform a weighted sum to obtain the total similarity between the query question and each candidate document:

[0201] def hybrid_retrieve(query, time_key, loc_key, index):

[0202] candidates = index[time_key][loc_key] # Initial screening of spacetime slices

[0203] vector_scores = calc_vector_similarity(query, candidates)

[0204] keyword_scores = calc_keyword_match(query, candidates)

[0205] # Dynamic fusion weight α, β can be trained or experience setting

[0206] scores = α × vector_scores + β × keyword_scores

[0207] return top_k(candidates, scores)

[0208] Preferably, since keywords are easy to drift with space-time, although the transformation of space-time leads to different literal, but the meaning is the same, while in the vector space, synonymous / paronymous / functionally equivalent expressions are very close in vector space, the training corpus naturally contains various expressions across time and region, so it learns the mapping of "different literal, same meaning", so with the change of space-time confidence, the importance of keyword matching degree and vector similarity to the total similarity also changes, the higher the space-time confidence, the stronger the space-time attribute of the query problem, the vector similarity can also represent the total similarity, therefore, step S52, optionally includes:

[0209] S521: According to the space-time confidence, determine the literal anchoring weight and the space-time confidence weight;

[0210] S522: Get the product of the literal anchoring weight and the keyword matching degree, get the literal relevance;

[0211] S523: Get the product of the space-time confidence weight and the vector similarity, get the semantic similarity;

[0212] S524: Sum the literal relevance and the semantic similarity, get the total similarity between the query question and each candidate document.

[0213] Specifically, optional but not limited to setting the constraint condition as literal anchoring weight + spatiotemporal confidence weight = 1, using the spatiotemporal confidence of the query question obtained in step S25 as the spatiotemporal weight, and calculating the literal anchoring weight according to the constraint condition and the spatiotemporal weight. Then, the product of the literal anchoring weight and the keyword matching degree is obtained to get the literal relevance, and the product of the spatiotemporal confidence weight and the vector similarity is obtained to get the semantic similarity. Finally, the literal relevance and semantic similarity are summed to obtain the total similarity between the query question and each candidate document. Thus, by using the spatiotemporal confidence of the query question, the weight coefficients of the keyword matching degree and the vector similarity are dynamically adjusted according to the spatiotemporal attributes of the query question. When the spatiotemporal attribute is strong, it means that the keywords may change literally with changes in time and space, which will reduce the accuracy of the keyword matching degree, and the weight of the vector similarity needs to be increased. When the spatiotemporal attribute is weak, the keyword matching degree is more accurate in measuring the similarity between the two, so the weight of the keyword matching degree needs to be increased, thereby improving the accuracy of the final total similarity.

[0214] As an example, the overall similarity between the query question and each candidate document can be calculated using the following code:

[0215] def extract_keywords_with_confidence(query_text, confidence_score,top_k=5):

[0216] words = tokenize(query_text)

[0217] tfidf_scores = compute_tfidf(words, query_text)

[0218] semantic_scores = compute_semantic_similarity(words) # Can be based on word vectors, dictionary matching, etc.

[0219] # Dynamic Fusion Weights

[0220] beta = min(confidence_score, 1.0)

[0221] alpha = 1.0 - beta

[0222] # Overall Rating

[0223] final_scores = {

[0224] w: alpha * tfidf_scores.get(w, 0) + beta * semantic_scores.get(w, 0)

[0225] for w in words

[0226] }

[0227] S53: Sort the candidate document segments according to the total similarity, and select a number of candidate document segments in sequence as the final query results.

[0228] Specifically, candidate document segments can be sorted according to the total similarity. The higher the similarity, the higher the relevance between the candidate document segment and the query question, and the closer it is to the answer the user wants to retrieve. Then, several candidate document segments are selected in sequence to obtain the final query results.

[0229] Optionally, the following code can be used to sort the candidate document segments according to the total similarity, and then select a number of candidate document segments in sequence as the final query results:

[0230] sorted_words = sorted(final_scores.items(), key=lambda x: x[1],reverse=True)

[0231] return [w for w, _ in sorted_words[:top_k]]

[0232] Preferably, during the user's retrieval process, the scope of their input query may be too narrow, resulting in too few or no query results. In this case, it is necessary to further expand the time or geographical slice of the user's input query to update the query scope, and then perform the query based on the updated scope to avoid query failures. Therefore, the step of sorting candidate document segments according to the total similarity and sequentially selecting several candidate document segments as the final determined query results may optionally include:

[0233] S531: Determine whether the number of document segments in the final query results is not less than the number threshold. If yes, obtain the final query results; otherwise:

[0234] S532: Obtain the time granularity and geographic granularity of the query question, and dynamically determine the time expansion threshold and geographic expansion threshold;

[0235] S533: Update the time slice and geographical slice of the query question based on the time expansion threshold and geographical expansion threshold, and return to step S4.

[0236] Specifically, it is optional, but not limited to, setting a quantity threshold and obtaining the number of document segments in the final query results. It is then determined whether the number is less than the quantity threshold. If so, it means that the number of document segments has met the requirements and can provide users with sufficient and accurate query results. If not, it means that the number of document segments does not meet the requirements, and users cannot obtain enough query results, or even no query results at all, which cannot meet the user's needs. Therefore, it is optional to dynamically adjust the time expansion threshold and the geographical expansion threshold according to the time granularity and geographical granularity of the query question, and update the time slice and geographical slice of the query question according to the adjusted time expansion threshold and geographical expansion threshold to expand the query scope of the query question. Then, return to step S3 to repeat the query steps to obtain the updated query results. This solves the problem of excessively sparse data in the query results by dynamically adjusting the expansion of the query scope.

[0237] For example, when the smallest unit of time slice for a query is a quarter, and the smallest unit of geographical slice is a province, then the time granularity and geographical granularity are quarter and province, respectively. Optionally, the time expansion threshold and geographical expansion threshold can be set to 1 quarter and 0.5 provinces, respectively. The time slice and geographical slice of the query are then updated based on these thresholds, and the process returns to step S4. It is worth noting that the 1 quarter and 0.5 provinces are only examples and are not a limitation.

[0238] For example, you can optionally update the time slice and geographic slice of the query using the following code:

[0239] def expand_candidates(query, time_key, loc_key):

[0240] near_times = get_adjacent_times(time_key, delta=1)

[0241] near_locs = get_adjacent_locations(loc_key, radius_km=200)

[0242] extended = []

[0243] for t in near_times:

[0244] for l in near_locs:

[0245] if index.get(t, {}).get(l):

[0246] extended += index[t][l]

[0247] return extended

[0248] Furthermore, since the document segments in the final query results contain too much content, customers may only need a simple and easy-to-understand result when querying. Therefore, it is possible to call any existing large language model to summarize each original document and output the conclusion as the final query result obtained by the user.

[0249] This embodiment presents a retrieval enhancement method based on spatiotemporal indexing according to the present invention. By extracting time slices and geographic slices from the original documents, an index key is constructed for each original document, resulting in an index table containing several index keys. Each index key includes a document segment identifier and a time slice and geographic slice mapped to the document segment identifier. This allows any subsequent query to directly locate the most relevant document segment by providing the time and geographic range, avoiding full-text scanning and significantly reducing computational resource consumption. Furthermore, metadata from the query question is extracted, and intent modeling and structured output are performed on the query question to obtain an updated query question. The metadata includes time slices, geographic slices, keywords, and spatiotemporal confidence. By converting fuzzy natural language questions into four structured metadata items—time slices, geographic slices, keywords, and spatiotemporal confidence—the retrieval boundaries are clarified, thereby first determining whether the spatiotemporal confidence exceeds a set threshold. A confidence threshold is set. If the spatiotemporal confidence of the query is low, traditional retrieval methods such as keyword / vector retrieval can be used directly to avoid missed detections caused by spatiotemporal filtering. If the confidence threshold is high, a retrieval enhancement method integrating spatiotemporal indexes can be used to balance efficiency and effectiveness. When the retrieval enhancement method integrating spatiotemporal indexes is selected, spatiotemporal retrieval of the index table is performed based on the time slice and geographical slice of the query, initially screening out several index keys and obtaining the corresponding original documents as candidate document segments. Through dual filtering of time and geography, noise that does not meet the requirements is quickly and accurately filtered out, reducing computing resources and improving the efficiency of subsequent steps. Then, based on the updated query, semantic retrieval is performed on the candidate document segments to obtain the final query results. A second screening is performed by obtaining the semantic similarity between the query and each candidate document segment to further improve the retrieval accuracy. This solves the problem that existing technologies cannot adaptively select whether to use spatiotemporal retrieval technology based on the query to improve retrieval efficiency and accuracy.

[0250] The key to this invention lies in:

[0251] The construction of four-structured metadata not only enables spatiotemporal and keyword retrieval based on time slices, geographic slices, and keywords, but also allows for selective spatiotemporal retrieval or traditional retrieval by adding spatiotemporal confidence. Before retrieving a query, the system selectively uses spatiotemporal retrieval or traditional retrieval based on the spatiotemporal confidence of the query. When the spatiotemporal confidence of the query is high, spatiotemporal retrieval is performed using the spatiotemporal attributes of the query to quickly filter document segments with the same spatiotemporal attributes as candidate document segments, improving retrieval efficiency and accuracy. When the spatiotemporal confidence of the query is low, traditional retrieval methods such as keyword / vector retrieval are used to avoid missed detections caused by spatiotemporal filtering.

[0252] When standardizing time entities, the format of the time entities is first converted according to the standardization template to obtain standard time slices. Then, a domain-specific template is determined according to the domain scenario, and the time entities are standardized according to the domain-specific template to obtain domain time slices. In this way, when non-artificial enthusiasts use the standard time format to query, they can locate the corresponding original text through the standard time slice. When articulate enthusiasts use professional terms to query, such as "ten-day period" or "solar term" in the agricultural field, or "trading week", "financial quarter" or "financial year" in the financial field, there is no need to convert the professional terms into standard time slices before searching. This effectively improves the search speed, reduces the error generated during conversion, and improves the search accuracy.

[0253] When standardizing geographic entities, since their shapes vary, using the same standardization format will result in geographic patches that are both low in error and concise in encoding. For example, latitude and longitude encoding requires cutting the entire Earth's surface into several grids, approximating rectangles, but the boundaries of geographic entities are mostly polygons. The larger the coverage area of ​​a geographic entity, the greater the error generated during cutting. However, region tree nodes themselves are polygons, resulting in smaller errors. Therefore, it is preferable to use region tree encoding to obtain geographic patches of geographic entities. When the coverage area of ​​a geographic entity is small, latitude and longitude encoding only requires a few characters to locate the corresponding geographic entity. Using region tree encoding, on the other hand, results in longer geographic patch codes due to the increased hierarchical structure. Selectively using different standardization formats based on the coverage area of ​​geographic entities can ensure both reduced error and concise encoding.

[0254] When calculating similarity, the weights of vector similarity and keyword matching are determined based on spatiotemporal confidence to improve retrieval accuracy. Since keywords are prone to spatiotemporal drift, but synonymous / near-synonymous / functionally equivalent expressions are very close in vector space, the training corpus naturally contains multiple expressions across time and regions. Therefore, spatiotemporal attributes have a greater impact on keywords than on vectors. Higher spatiotemporal confidence results in a greater weight for keyword matching, improving the efficiency of spatiotemporal retrieval; lower spatiotemporal confidence results in a greater weight for vector similarity, improving the accuracy of spatiotemporal retrieval. The two are weighted and fused to ensure both retrieval efficiency and accuracy during the spatiotemporal retrieval process.

[0255] On the other hand, the present invention also provides a computer storage medium storing executable program code; the executable program code is used to execute the above-mentioned retrieval enhancement method of any of the fused spatiotemporal indexes.

[0256] On the other hand, the present invention also provides a terminal device, including a memory and a processor; the memory stores program code that can be executed by the processor; the program code is used to execute the above-described retrieval enhancement method for any of the fused spatiotemporal indexes.

[0257] For example, the program code can be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the program code in the terminal device.

[0258] The terminal device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that the terminal device may also include input / output devices, network access devices, buses, etc.

[0259] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0260] The memory can be an internal storage unit of the terminal device, such as a hard drive or RAM. The memory can also be an external storage device of the terminal device, such as a plug-in hard drive, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory can include both internal and external storage units of the terminal device. The memory is used to store the program code and other programs and data required by the terminal device. The memory can also be used to temporarily store data that has been output or will be output.

[0261] The aforementioned computer storage medium and terminal device are created based on the aforementioned retrieval enhancement method of fused spatiotemporal index. Their technical functions and beneficial effects will not be elaborated here. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0262] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.

Claims

1. A method for retrieval enhancement by fusing spatio-temporal indexes, characterized in that, Comprise: S1: extract the time slice and the geographical slice in the original document, construct the index key of each original document, and obtain an index table comprising several index keys; The index key comprises: a document segment identifier and a time slice and a geographical slice mapped with the document segment identifier; S2: extract the metadata in the query question, model the intention of the query question and output the structure to obtain an updated query question; the metadata comprises: time slice, geographical slice, keyword and spatiotemporal confidence; comprising: constructing and training a spatiotemporal entity recognition model taking the query question as input and outputting time entity and geographical entity; input the query question into the trained spatiotemporal entity recognition model to obtain time entity and geographical entity; standardize the time entity and geographical entity to obtain the time slice and geographical slice; split the query question into several words and calculate the TF-IDF value of each word, sort the words according to the TF-IDF value, and select several words as keywords in order; input the query question into the spatiotemporal intention classifier to obtain the spatiotemporal confidence of the query question; S3: determine whether the spatiotemporal confidence exceeds the set confidence threshold, if yes, then: S4: according to the time slice and the geographical slice of the query question, perform spatiotemporal retrieval on the index table to preliminarily screen several index keys, and obtain the corresponding original document as a candidate document segment; S5: according to the updated query question, perform semantic retrieval on each candidate document segment to obtain the final query result.

2. The method of claim 1, wherein, The step of extracting the time slice of the original document comprises: Extracting the time entity and the domain scene of the original document; Converting the time entity into a standard time slice according to a standardization template; Determining a domain-specific template according to the domain scene; the domain-specific template comprises a time granularity and a domain standardization format; determining the time range of the time entity according to the time granularity, and converting the time range into a domain time slice according to the standardization format; Splicing the standard time slice and the domain time slice to obtain the finally determined time slice.

3. The method of claim 1, wherein, The step of extracting the geographical slice of the original document comprises: Extracting all geographical description words in the original document and counting the frequency of each geographical description word, and taking the geographical description word with the highest frequency as the geographical entity; Obtain the coverage range of the geographical entity, and determine whether the coverage range is greater than the set range threshold; If yes, encode the geographical entity according to the region tree; if not, encode the geographical entity according to the latitude and longitude; obtain the geographical slice of the geographical entity.

4. The method of claim 1, wherein, Before standardizing the time entity and the geographical entity, the step further comprises: Determine whether the time entity is a fuzzy time entity, if not, then do not change, if yes, then: Obtain the time entity adjacent to the fuzzy time entity as a reference time; According to the reference time, the fuzzy time entity and the prior matching logic, obtain the clear time range as the optimized time entity; Or / and: determine whether the geographical entity is a fuzzy geographical entity, if not, then do not change, if yes, then: Obtain the geographical entity adjacent to the fuzzy geographical entity as a reference location; According to the reference location, the fuzzy geographical entity and the prior analysis logic, obtain the clear geographical position as the optimized geographical entity.

5. The method according to any one of claims 1 to 4, characterized in that, The step of performing semantic retrieval on the candidate document segments according to the updated query question to obtain the final query result comprises: obtaining the vector similarity and the keyword matching degree of the query question and each candidate document; determining the total similarity between the query question and each candidate document according to the spatiotemporal confidence, the vector similarity and the keyword matching degree; ranking the candidate document segments according to the total similarity, and sequentially selecting a plurality of candidate document segments as the final query result.

6. The method of claim 5, wherein, The step of determining the total similarity between the query question and each candidate document according to the spatiotemporal confidence, the vector similarity and the keyword matching degree comprises: determining the literal anchor weight and the spatiotemporal confidence weight according to the spatiotemporal confidence; obtaining the product of the literal anchor weight and the keyword matching degree to obtain the literal relevance; obtaining the product of the spatiotemporal confidence weight and the vector similarity to obtain the semantic similarity; summing the literal relevance and the semantic similarity to obtain the total similarity between the query question and each candidate document.

7. The method of claim 6, wherein, The step of ranking the candidate document segments according to the total similarity and sequentially selecting a plurality of candidate document segments as the final query result further comprises: determining whether the number of document segments in the final query result is not less than a quantity threshold, if yes, obtaining the final query result, and if no, then: obtaining the time granularity and the geographic granularity of the query question, and dynamically determining the time expansion threshold and the geographic expansion threshold; updating the time slice and the geographic slice of the query question according to the time expansion threshold and the geographic expansion threshold, and returning to step S4.

8. A computer storage medium, characterized in that The storage has executable program code; the executable program code is used for executing the retrieval enhancement method of the fusion spatiotemporal index according to any one of claims 1-7.

9. A terminal device, comprising: The memory stores program code executable by the processor; the program code is used for executing the retrieval enhancement method of the fusion spatiotemporal index according to any one of claims 1-7.

Citation Information

Patent Citations

  • Space-time retrieval method and device based on multivariate data fusion, equipment and medium

    CN116775722A

  • Heuristic knowledge navigation recommendation method fusing user retrieval intention

    CN118939787A

  • Information retrieval method and device, electronic equipment, storage medium and computer program product

    CN119917623A